Do not change function and class names when minifying JS (#10223)

This commit is contained in:
Kenn Jacobsen
2021-05-04 13:40:35 +02:00
committed by GitHub
parent f344479b40
commit b7b3eeb143
2 changed files with 12 additions and 2 deletions

View File

@@ -19,12 +19,17 @@ function js() {
var stream = new MergeStream();
var task = gulp.src(config.sources.globs.js);
// NOTE: if you change something here, you probably also need to change it in the processJs util
if (config.compile.current.minify === true) {
task = task.pipe(
minify({
noSource: true,
ext: { min: '.min.js' },
mangle: false
mangle: false,
compress: {
keep_classnames: true,
keep_fnames: true
}
})
);
} else {

View File

@@ -36,12 +36,17 @@ module.exports = function (files, out) {
task = task.pipe(concat(out)).pipe(wrap('(function(){\n%= body %\n})();'))
// NOTE: if you change something here, you probably also need to change it in the js task
if (config.compile.current.minify === true) {
task = task.pipe(
minify({
noSource:true,
ext: {min:'.min.js'},
mangle: false
mangle: false,
compress: {
keep_classnames: true,
keep_fnames: true
}
})
);
} else {