-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack-build.config.js
46 lines (32 loc) · 1.21 KB
/
webpack-build.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
const webpack = require( 'webpack' );
// Inherit main config
const webpackConfig = require( './webpack.config.js' );
// Override watch set for development
// webpackConfig.watch = false;
// Where do you want to export bundle files
// webpackConfig.output.path = `dist`;
// Path wehere bundle files will be served on production env
webpackConfig.output.publicPath = `./`;
webpackConfig.plugins.push(
// Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin
// Only emit files when there are no errors
new webpack.NoErrorsPlugin(),
// Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin
// Dedupe modules in the output
new webpack.optimize.DedupePlugin(),
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
// Minify all javascript, switch loaders to minimizing mode
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
);
// Reference: https://github.com/wbuchwalter/tslint-loader#usage
webpackConfig.tslint = {
// tslint does not interrupt the compilation by default
// if you want any file with tslint errors to fail
// set failOnHint to true
failOnHint: true
}
module.exports = webpackConfig;