Skip to content

Commit

Permalink
build: Disable merge_vars in Gruntfile uglify process
Browse files Browse the repository at this point in the history
`merge_vars` aggressively reuses variable names, which can lead to
unexpected behavior or runtime errors in certain cases.
It was introduced grunt-contrib-uglify 5.0.1 and it is now turned on by default.
We are turning it off to ensure it does not break this project.
  • Loading branch information
Tim Addai committed Sep 11, 2024
1 parent dbf8f7d commit 238def7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ module.exports = function(grunt) {
sourceMap: DEBUG,
sourceMapIncludeSources: DEBUG,
mangle: !DEBUG,
compress: !DEBUG,
// Disable the `merge_vars` option in the compression phase.
// `merge_vars` aggressively reuses variable names, which can lead to
// unexpected behavior or runtime errors in certain cases.
compress: DEBUG ? false : { merge_vars: false }, // eslint-disable-line camelcase
beautify: DEBUG,
},
},
Expand Down

0 comments on commit 238def7

Please sign in to comment.