-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.prod.js
35 lines (33 loc) · 938 Bytes
/
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
34
35
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const paths = require('./config/paths');
const appPackageJson = require(paths.appPackageJson);
const clientBundleOutputDir = appPackageJson.clientBundleOutputDir;
module.exports = merge(common, {
mode: 'production',
devtool: false,
module: {
rules: [
// {
// test: /\.html$/,
// use: [
// {
// loader: 'html-loader',
// options: { minimize: true }
// }
// ]
// }
]
},
plugins: [
new CleanWebpackPlugin(clientBundleOutputDir, { allowExternal: true }),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
});