File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -110,15 +110,27 @@ const componentBuilds = components
110
110
input : `${ component } /index.ts` ,
111
111
output : {
112
112
file : `firebase-${ component } .js` ,
113
- format : 'iife ' ,
113
+ format : 'umd ' ,
114
114
sourcemap : true ,
115
115
extend : true ,
116
116
name : GLOBAL_NAME ,
117
117
globals : {
118
118
'@firebase/app' : GLOBAL_NAME
119
119
} ,
120
- banner : `try {` ,
121
- footer : `} catch(err) {
120
+
121
+ /**
122
+ * use iife to avoid below error in the old Safari browser
123
+ * SyntaxError: Functions cannot be declared in a nested block in strict mode
124
+ * https://github.com/firebase/firebase-js-sdk/issues/1228
125
+ *
126
+ */
127
+
128
+ intro : `
129
+ try {
130
+ (function() {` ,
131
+ outro : `
132
+ }).apply(this, arguments);
133
+ } catch(err) {
122
134
console.error(err);
123
135
throw new Error(
124
136
'Cannot instantiate firebase-${ component } - ' +
You can’t perform that action at this time.
0 commit comments