-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
35 lines (30 loc) · 899 Bytes
/
webpack.prod.js
File metadata and controls
35 lines (30 loc) · 899 Bytes
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
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ip = require('ip');
const common = require('./webpack.common.js');
module.exports = merge(common, {
devtool: 'source-map',
mode: 'production',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.[name].[hash].js',
},
plugins: [
new webpack.DefinePlugin({
// this is for how react is told to use production https://facebook.github.io/react/docs/optimizing-performance.html
'process.env': {
NODE_ENV: "'production'",
},
}),
// new UglifyJSPlugin({
// sourceMap: true,
// }),
new HtmlWebpackPlugin({
template: './index.prod.ejs',
title: 'Fourth Person',
}),
],
});