-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathwebpack.examples.js
40 lines (31 loc) · 1011 Bytes
/
webpack.examples.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
/* global module */
const merge = require('deep-assign');
const webpack = require('webpack');
const options = require('./options');
const base = require('./webpack.base.js');
// do not exclude the autonumeric in the bundle of the examples page
delete base.externals;
const config = merge(base, {
entry: options.paths.resolve('examples-src/index.js'),
output: {
filename: 'examples.bundle.js',
path : options.paths.output.examples,
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
}),
// Set the production environment
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
VERSION : JSON.stringify(options.version),
}),
// Minify with dead-code elimination
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
}),
],
});
module.exports = config;