-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.prod.js
33 lines (32 loc) · 1.07 KB
/
webpack.prod.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
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new HtmlWebpackPlugin({
template: 'build/chapter1.html',
filename: 'chapter1.html',
}),
new HtmlWebpackPlugin({
template: 'build/chapter2.html',
filename: 'chapter2.html',
}),
new HtmlWebpackPlugin({
template: 'build/chapter3.html',
filename: 'chapter3.html',
}),
new HtmlWebpackPlugin({
template: 'build/chapter4.html',
filename: 'chapter4.html',
}),
new BundleAnalyzerPlugin(),
],
});