-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
31 lines (26 loc) · 825 Bytes
/
webpack.config.js
File metadata and controls
31 lines (26 loc) · 825 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
const path = require('path');
const webpack = require('webpack');
const webpackBaseConfig = require('./webpack.base.config.js');
const packageJson = require('./package.json');
const plugins = webpackBaseConfig.plugins || [];
module.exports = Object.assign({}, webpackBaseConfig, {
devtool: 'source-map',
output: Object.assign({}, webpackBaseConfig.output, {
publicPath: '',
sourceMapFilename: "[name].bundle.js.map",
filename: '[name].bundle.js'
}),
plugins: [
...plugins,
new webpack.DefinePlugin({
'process.env': { APP_VERSION: JSON.stringify(packageJson.version) },
}),
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('production') }
}),
new webpack.optimize.UglifyJsPlugin({
drop_console: true,
mangle: false,
}),
],
});