-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
34 lines (30 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
34
const Webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const commonConfig = require('./webpack.common');
module.exports = webpackMerge.merge(commonConfig, {
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [new CssMinimizerPlugin()
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: './config.json',
to: 'config.json'
}
]
}),
new Webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"',
'process.env.GEOSERVER_URL': JSON.stringify(process.env.GEOSERVER_URL || '/geoserver'),
'process.env.GEOSTREAMS_URL': JSON.stringify(process.env.GEOSTREAMS_URL || '/geostreams'),
'process.env.BMP_API_URL': JSON.stringify(process.env.BMP_API_URL || '/bmp-api/v1.0')
})
]
});