-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathwebpack.config.js
36 lines (35 loc) · 893 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
30
31
32
33
34
35
36
const webpack = require('webpack');
const IS_PROD = process.argv.indexOf('-p') > -1;
module.exports = {
devtool: IS_PROD ? 'source-map' : 'eval',
entry: './demo/entry.ts',
output: {
filename: 'demo.js',
path: IS_PROD ? './demo' : ''
},
module: {
preLoaders: [{
test: /\.ts$/, loader: 'tslint-loader?emitErrors=false&failOnHint=false', exclude: /node_modules/
}],
loaders: [{
test: /\.ts$/, loader: 'awesome-typescript-loader', exclude: /node_modules/
}]
},
resolve: {
extensions: ['', '.ts', '.js']
},
devServer: {
port: 8000,
inline: true,
hot: true,
historyApiFallback: true,
contentBase: 'demo'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.DefinePlugin({
ENV: JSON.stringify(IS_PROD ? 'production' : 'development')
})
]
};