Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
72 lines (70 loc) · 1.92 KB
/
Copy pathwebpack.config.js
File metadata and controls
72 lines (70 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var webpack = require('webpack');
module.exports ={
devtool: 'source-map',
entry: {
'app': './app/main.ts',
'vendor': './app/vendor.ts',
'polyfills':'./app/polyfills.ts'
},
resolve: {
extensions: ['.ts', '.js', '.json', '.css', '.scss', '.html']
},
output: {
path: __dirname+'/dist',
filename: '[chunkhash].[name].js',
publicPath: '/'
},
devServer:{
contentBase: path.join(__dirname, "dist/"),
compress: true,
port:5000
},
module:{
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
loaders: [
'awesome-typescript-loader',
'angular2-template-loader',
'source-map-loader',
'tslint-loader'
]
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file-loader?name=public/fonts/[name].[ext]'
},
{
test: /\.css$/,
loader: ["style-loader","css-loader"]
},
{
test: /\.html$/,
loader: "raw-loader"
}
],
exprContextCritical: false
},
plugins:[
// new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: ['app','vendor','polyfills']
}),
new CleanWebpackPlugin(
['dist'], {
root: __dirname,
verbose: true,
dry: false,
exclude: []
}),
new HtmlWebpackPlugin({
filename: 'index.html',
inject: 'body',
template: 'index.html'
})
]
};