Skip to content

Commit 43a1cc9

Browse files
authored
Build option for console that replaces gstatic firebase-app.js url with relative import (#7243)
New gulp task for build:internal
1 parent 0832dca commit 43a1cc9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/firebase/gulpfile.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,13 @@ gulp.task('cdn-type-module-path', function () {
3838
.pipe(gulp.dest('.'))
3939
);
4040
});
41+
42+
//google3 does not allow imports from absolute URLs, so we cannot use the gstatic link
43+
gulp.task('cdn-type-module-path-internal', function () {
44+
return gulp
45+
.src(files)
46+
.pipe(sourcemaps.init({ loadMaps: true }))
47+
.pipe(replace(/(['"])@firebase\/app(['"])/g, "'./firebase-app.js'"))
48+
.pipe(sourcemaps.write('.'))
49+
.pipe(gulp.dest('.'));
50+
});

packages/firebase/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@
367367
},
368368
"scripts": {
369369
"build": "rollup -c && gulp cdn-type-module-path && yarn build:compat",
370+
"build:internal": "rollup -c && gulp cdn-type-module-path-internal && yarn build:compat",
370371
"build:compat": "rollup -c compat/rollup.config.js",
371372
"dev": "rollup -c -w",
372373
"test": "echo 'No test suite for firebase wrapper'",

0 commit comments

Comments
 (0)