Skip to content

Commit f47f7fb

Browse files
Tweak the minifier so that it works correctly with ES6 classes, fixes #794 (#796)
There were two issues with the minifier: – it was removing class names and – was merging variable declarations so that sometimes the variables might be left undefined (merging might clash with other code transformations)
1 parent 0451936 commit f47f7fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ gulp.task("transpile", function () {
9898
gulp.task("minify", function () {
9999
return merge(
100100
gulp.src("dist/deps.js").pipe(sourcemaps.init()),
101-
gulp.src("dist/mavo-nodeps.js").pipe(sourcemaps.init()).pipe(minify({mangle: false}))
101+
gulp.src("dist/mavo-nodeps.js").pipe(sourcemaps.init()).pipe(minify({mangle: false, keepClassName: true, mergeVars: false}))
102102
)
103103
.pipe(concat("mavo.min.js"))
104104
.pipe(sourcemaps.write("maps"))
@@ -108,7 +108,7 @@ gulp.task("minify", function () {
108108
gulp.task("minify-es5", function () {
109109
return merge(
110110
gulp.src("dist/deps.js").pipe(sourcemaps.init()),
111-
transpileStream().pipe(minify({mangle: false}))
111+
transpileStream().pipe(minify({mangle: false, keepClassName: true, mergeVars: false}))
112112
)
113113
.pipe(concat("mavo.es5.min.js"))
114114
.pipe(sourcemaps.mapSources((sourcePath, file) => "../" + sourcePath))

0 commit comments

Comments
 (0)