-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
47 lines (45 loc) · 1.18 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
47
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
vendor: './src/vendor.ts',
main: './src/main.ts'
},
output: {
path: __dirname + '/dist',
filename: '[name].bundle.js'
},
module: {
loaders: [{
test: /\.ts$/,
loaders:['ts-loader'],
exclude: /node_modules|typings/
}, {
test: /\.css$/,
loader: 'raw-loader'
},{
test: /\.html$/,
loader: 'raw-loader'
}]
},
resolve: {
extensions: ['', '.js', '.ts']
},
plugins: [
/*
* Plugin: CommonsChunkPlugin
* See: https://webpack.github.io/docs/list-of-plugins.html#commonschunkplugin
* See: https://github.com/webpack/docs/wiki/optimization#multi-page-app
*/
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor'
}),
/*
* Plugin: HtmlWebpackPlugin
* See: https://github.com/ampedandwired/html-webpack-plugin
*/
new HtmlWebpackPlugin({
template: 'src/index.html'
})
]
}