forked from geosolutions-it/lhtac-webgis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprod-webpack.config.js
31 lines (28 loc) · 1.22 KB
/
prod-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
var webpackConfig = require('./webpack.config.js');
var path = require("path");
var UglifyJsPlugin = require("webpack/lib/optimize/UglifyJsPlugin");
var DefinePlugin = require("webpack/lib/DefinePlugin");
var NormalModuleReplacementPlugin = require("webpack/lib/NormalModuleReplacementPlugin");
webpackConfig.plugins = [
new DefinePlugin({
"__DEVTOOLS__": false
}),
new DefinePlugin({
'process.env': {
'NODE_ENV': '"production"'
}
}),
new NormalModuleReplacementPlugin(/leaflet$/, path.join(__dirname, "MapStore2", "web", "client", "libs", "leaflet")),
new NormalModuleReplacementPlugin(/openlayers$/, path.join(__dirname, "MapStore2", "web", "client", "libs", "openlayers")),
new NormalModuleReplacementPlugin(/proj4$/, path.join(__dirname, "MapStore2", "web", "client", "libs", "proj4")),
new UglifyJsPlugin({
compress: {warnings: false},
mangle: true
})
];
webpackConfig.devtool = undefined;
webpackConfig.debug = false;
// this is a workaround for this issue https://github.com/webpack/file-loader/issues/3
// use `__webpack_public_path__` in the index.html when fixed
webpackConfig.output.publicPath = "/lhtac-webgis/dist/";
module.exports = webpackConfig;