|
|
@ -3,10 +3,9 @@ const CompressionPlugin = require("compression-webpack-plugin"); |
|
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); |
|
|
|
const path = require('path'); |
|
|
|
module.exports = { |
|
|
|
mode: 'production', |
|
|
|
cache: false, |
|
|
|
context: __dirname, |
|
|
|
entry: '../../../services/init', |
|
|
|
mode: 'production', |
|
|
|
node: { |
|
|
|
__dirname: true |
|
|
|
}, |
|
|
@ -14,17 +13,23 @@ module.exports = { |
|
|
|
path: __dirname + '/../../../public', |
|
|
|
filename: 'bundle.js' |
|
|
|
}, |
|
|
|
optimization: { |
|
|
|
minimize: true, |
|
|
|
minimizer: [ |
|
|
|
new UglifyJsPlugin({ |
|
|
|
exclude: [/\.min\.js$/gi] // skip pre-minified libs
|
|
|
|
}) |
|
|
|
] |
|
|
|
}, |
|
|
|
devtool: 'cheap-module-source-map', |
|
|
|
plugins: [ |
|
|
|
new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]), |
|
|
|
new webpack.LoaderOptionsPlugin({ |
|
|
|
options: { |
|
|
|
context: __dirname, |
|
|
|
mode: 'production', |
|
|
|
optimization: { |
|
|
|
minimize: true, |
|
|
|
minimizer: [ |
|
|
|
new UglifyJsPlugin({ |
|
|
|
exclude: [/\.min\.js$/gi] // skip pre-minified libs
|
|
|
|
}) |
|
|
|
] |
|
|
|
}, |
|
|
|
} |
|
|
|
}), |
|
|
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), |
|
|
|
new webpack.NoEmitOnErrorsPlugin(), |
|
|
|
new CompressionPlugin({ |
|
|
|
asset: "[path].gz[query]", |
|
|
|