-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwebpack.config.js
46 lines (43 loc) · 1.19 KB
/
webpack.config.js
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
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
module.exports = {
debug: true,
devtool: 'source-map',
entry: {
'tests': './app/tests',
'vendor': ['./app/polyfills', './app/vendor'],
'app': './app/main'
},
output: {
path: __dirname + "/dist",
filename: "[name].js",
publicPath: "dist/"
},
resolve: {
extensions: ['', '.ts', '.js', '.jpg', '.jpeg', '.gif', '.png', '.css']
},
module: {
loaders: [
{ test: /\.(jpg|jpeg|gif|png)$/, loader:'file-loader?name=img/[path][name].[ext]' },
{ test: /\.css$/, loader:'raw-loader' },
{ test: /\.html$/, loaders: ['html-loader'] },
{ test: /\.ts$/, loaders: ['awesome-typescript-loader'], exclude: /node_modules/}
]
},
modulesDirectories: ['node_modules'],
plugins: [
new CommonsChunkPlugin({ name: 'vendor' })
],
node: {
__filename: true
},
devServer: {
inline:true,
port: 8080,
historyApiFallback: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
}
}
};