Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Commit

Permalink
set typeofs: false to prevent mangling typeofs by uglify
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey Smolenchuk committed Jul 22, 2018
1 parent 84a09c7 commit c94d03a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,13 @@ function getConfig({target, env, dir, watch, cover}) {
parallel: true, // default from webpack
uglifyOptions: {
compress: {
// typeofs: true (default) transforms typeof foo == "undefined" into foo === void 0.

// This mangles mapbox-gl creating an error when used alongside with window global mangling:
// https://jeng.uberinternal.com/browse/WPT-1185
// https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/189
typeofs: false,

inline: 1, // inline=2 can cause const reassignment (https://github.com/mishoo/UglifyJS2/issues/2842)
},
},
Expand Down

0 comments on commit c94d03a

Please sign in to comment.