forked from seolahkim/AngularJS2-Rails5-Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
30 lines (28 loc) · 884 Bytes
/
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
const path = require('path');
const webpack = require('webpack');
const CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
module.exports = {
devtool: 'source-map',
debug: true,
entry: {
'vendor': './angular2/vendor.ts',
'app': './angular2/launch.ts'
},
output: {
filename: 'bundle.js',
path: './app/assets/javascripts/angular2'
},
resolve: {
root: [path.join(__dirname, 'angular2/assets/scripts')],
extensions: ['', '.webpack.js', '.web.js', '.ts', '.tsx', '.js', '.html', '.json', 'manifest.json']
},
module: {
loaders: [
{ test: /\.ts?$/, exclude: /node_modules/, loader: 'ts-loader' }
]
},
plugins: [
new CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js', minChunks: Infinity }),
new CommonsChunkPlugin({ name: 'common', filename: 'common.js', minChunks: 2, chunks: ['app', 'vendor'] })
]
}