-
Notifications
You must be signed in to change notification settings - Fork 14
/
webpack.config.js
37 lines (34 loc) · 1.03 KB
/
webpack.config.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
const path = require('path');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const webpackBaseConfig = require('./webpack.base.config.js');
const packageJson = require('./package.json');
module.exports = Object.assign({}, webpackBaseConfig, {
devtool: 'source-map',
mode: 'production',
output: Object.assign({}, webpackBaseConfig.output, {
path: path.resolve(__dirname, 'docs'),
publicPath: '',
sourceMapFilename: "[name].bundle.js.map",
filename: '[name].bundle.js',
}),
plugins: [
...webpackBaseConfig.plugins,
new webpack.DefinePlugin({
'process.env': { REPOSITORY_URL: JSON.stringify(packageJson.repository.url) },
}),
new webpack.DefinePlugin({
'process.env': { APP_VERSION: JSON.stringify(packageJson.version) },
}),
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('production') }
}),
],
optimization: {
minimizer: [
new UglifyJsPlugin({
sourceMap: true,
}),
],
},
});