forked from firebase/firebase-js-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for issue where firestore could not be loaded alongside firebase.…
…js (firebase#196) * Add gulpfile to properly build firebase.js binary * [AUTOMATED]: Prettier Code Styling * [AUTOMATED]: License Headers * Update yarn.lock * Refactor to use external maps (THANKS @mikelehen) * Add firebase files to .prettierignore
- Loading branch information
1 parent
d49daa0
commit 3f827b8
Showing
5 changed files
with
210 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# This file is pre-built and need not be formatted | ||
packages/auth/src/auth.js | ||
packages/firebase/firebase* | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/** | ||
* Copyright 2017 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
const concat = require('gulp-concat'); | ||
const gulp = require('gulp'); | ||
const sourcemaps = require('gulp-sourcemaps'); | ||
const { resolve } = require('path'); | ||
const webpack = require('webpack'); | ||
const webpackStream = require('webpack-stream'); | ||
const merge = require('merge2'); | ||
|
||
function compileWebpack(watch = false) { | ||
return () => | ||
gulp | ||
.src([ | ||
'./app/index.js', | ||
'./auth/index.js', | ||
'./database/index.js', | ||
'./firestore/index.js', | ||
'./messaging/index.js', | ||
'./storage/index.js' | ||
]) | ||
.pipe( | ||
webpackStream( | ||
{ | ||
watch, | ||
config: require('./webpack.config') | ||
}, | ||
webpack | ||
) | ||
) | ||
.pipe(gulp.dest('.')); | ||
} | ||
|
||
function concatFiles() { | ||
return gulp | ||
.src([ | ||
'./firebase-app.js', | ||
'./firebase-auth.js', | ||
'./firebase-database.js', | ||
'./firebase-messaging.js', | ||
'./firebase-storage.js' | ||
]) | ||
.pipe(sourcemaps.init({ loadMaps: true })) | ||
.pipe(concat('firebase.js')) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest('.')); | ||
} | ||
|
||
gulp.task('compile-webpack', compileWebpack()); | ||
gulp.task('concat-files', concatFiles); | ||
|
||
const buildSdk = gulp.series(compileWebpack(), concatFiles); | ||
|
||
gulp.task('build', buildSdk); | ||
gulp.task('watch', () => { | ||
compileWebpack(true)(); | ||
gulp.watch( | ||
[ | ||
'./firebase-app.js', | ||
'./firebase-auth.js', | ||
'./firebase-database.js', | ||
'./firebase-messaging.js', | ||
'./firebase-storage.js' | ||
], | ||
concatFiles | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.