@@ -29,6 +29,10 @@ import compatPkg from './package.json';
2929import appPkg from './app/package.json' ;
3030
3131const external = Object . keys ( pkg . dependencies || { } ) ;
32+ const uglifyOptions = {
33+ mangle : true ,
34+ webkit : true // Necessary to avoid https://bugs.webkit.org/show_bug.cgi?id=223533
35+ } ;
3236
3337/**
3438 * Global UMD Build
@@ -123,7 +127,7 @@ const appBuilds = [
123127 format : 'umd' ,
124128 name : GLOBAL_NAME
125129 } ,
126- plugins : [ ...plugins , typescriptPluginCDN , uglify ( ) ]
130+ plugins : [ ...plugins , typescriptPluginCDN , uglify ( uglifyOptions ) ]
127131 }
128132] ;
129133
@@ -163,7 +167,7 @@ const componentBuilds = compatPkg.components
163167 {
164168 input : `${ __dirname } /${ component } /index.ts` ,
165169 output : createUmdOutputConfig ( `firebase-${ component } -compat.js` ) ,
166- plugins : [ ...plugins , typescriptPluginCDN , uglify ( ) ] ,
170+ plugins : [ ...plugins , typescriptPluginCDN , uglify ( uglifyOptions ) ] ,
167171 external : [ '@firebase/app-compat' , '@firebase/app' ]
168172 }
169173 ] ;
@@ -197,7 +201,7 @@ const completeBuilds = [
197201 sourcemap : true ,
198202 name : GLOBAL_NAME
199203 } ,
200- plugins : [ ...plugins , typescriptPluginCDN , uglify ( ) ]
204+ plugins : [ ...plugins , typescriptPluginCDN , uglify ( uglifyOptions ) ]
201205 } ,
202206 /**
203207 * App Node.js Builds
@@ -244,7 +248,7 @@ const completeBuilds = [
244248 typescriptPluginCDN ,
245249 json ( ) ,
246250 commonjs ( ) ,
247- uglify ( )
251+ uglify ( uglifyOptions )
248252 ]
249253 } ,
250254 /**
0 commit comments