-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathwebpack.config.js
52 lines (51 loc) · 1.1 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
48
49
50
51
52
var path = require('path'),
webpack = require("webpack"),
demoPath = path.join(__dirname, 'demo'),
wwwPath = path.join(__dirname, 'www'),
docsPath = path.join(__dirname, 'docs'),
pkg = require('./package.json'),
HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
bundle: [
'core-js',
'reflect-metadata/Reflect.js',
'zone.js',
'@angular/core',
'rxjs',
'rxjs/add/operator/toPromise',
path.join(demoPath, 'index.ts')
]
},
output: {
path: wwwPath,
filename: '[name]-[hash:6].js'
},
module: {
loaders: [
{
test: /\.json$/,
loader: "json"
},
{
test: /\.ts$/,
exclude: /(node_modules)/,
loader: 'ts'
}
]
},
resolve: {
root: path.resolve(__dirname),
extensions: ['', '.ts', '.js', '.json']
},
ts: {
configFileName: './tsconfig.demo.json'
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new HtmlWebpackPlugin({
pkg: pkg,
inject: 'body',
template: path.join(demoPath, 'index.html')
})]
};