build(umd-module): prevent mangling (#4320)
* Prevent mangling of names in UMD distribution This makes debugging easier in general. * use `uglifyOptions`
This commit is contained in:
@@ -52,6 +52,7 @@ module.exports = function(rules, options) {
|
|||||||
hot: false,
|
hot: false,
|
||||||
separateStylesheets: true,
|
separateStylesheets: true,
|
||||||
minimize: false,
|
minimize: false,
|
||||||
|
mangle: false,
|
||||||
longTermCaching: false,
|
longTermCaching: false,
|
||||||
sourcemaps: false,
|
sourcemaps: false,
|
||||||
}, options._special)
|
}, options._special)
|
||||||
@@ -69,6 +70,10 @@ module.exports = function(rules, options) {
|
|||||||
|
|
||||||
plugins.push(
|
plugins.push(
|
||||||
new UglifyJsPlugin({
|
new UglifyJsPlugin({
|
||||||
|
uglifyOptions: {
|
||||||
|
mangle: specialOptions.mangle,
|
||||||
|
beautify: !specialOptions.mangle,
|
||||||
|
},
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
}),
|
}),
|
||||||
new webpack.LoaderOptionsPlugin({
|
new webpack.LoaderOptionsPlugin({
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ module.exports = require("./make-webpack-config.js")(rules, {
|
|||||||
_special: {
|
_special: {
|
||||||
separateStylesheets: true,
|
separateStylesheets: true,
|
||||||
minimize: true,
|
minimize: true,
|
||||||
|
mangle: true,
|
||||||
sourcemaps: true,
|
sourcemaps: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ module.exports = require("./make-webpack-config.js")(rules, {
|
|||||||
_special: {
|
_special: {
|
||||||
separateStylesheets: true,
|
separateStylesheets: true,
|
||||||
minimize: true,
|
minimize: true,
|
||||||
|
mangle: true,
|
||||||
sourcemaps: true,
|
sourcemaps: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user