Skip to content

Commit 5d71b22

Browse files
committed
Hack fix for terser problem
1 parent d9808aa commit 5d71b22

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/firestore/rollup.shared.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ const manglePrivatePropertiesOptions = {
145145
beautify: true
146146
},
147147
mangle: {
148+
// Temporary hack fix for an issue where mangled code causes some downstream
149+
// bundlers (Babel?) to confuse the same variable name in different scopes.
150+
// This can be removed if the problem in the downstream library is fixed
151+
// or if terser's mangler provides an option to avoid mangling everything
152+
// that isn't a property.
153+
reserved: ['_getProvider'],
148154
properties: {
149155
regex: /^__PRIVATE_/,
150156
// All JS Keywords are reserved. Although this should be taken cared of by
@@ -284,7 +290,12 @@ exports.es2017ToEs5Plugins = function (mangled = false) {
284290
comments: 'all',
285291
beautify: true
286292
},
287-
mangle: true
293+
// See comment above `manglePrivatePropertiesOptions`. This build did
294+
// not have the identical variable name issue but we should be
295+
// consistent.
296+
mangle: {
297+
reserved: ['_getProvider']
298+
}
288299
}),
289300
sourcemaps()
290301
];

0 commit comments

Comments
 (0)