Description
Following up on #45 and on @jshcrowthe's comment:
Use case: just importing the database layer to develop and unit test individual modules that need a common async data store. They will likely eventually be used in the browser but development, unit testing, and packaging is just so much easier and faster in node.
//app.js
import * as firebase from './node_modules/firebase/app'
import './node_modules/firebase/database'
firebase.initializeApp({databaseURL: 'x.y.z'}, 'local').database().goOffline()
- using rollup in the CLI
>rollup -o app.bld.js -f cjs app.js
'initializeApp' is not exported by 'node_modules\firebase\app.js'
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
- using rollup in a script with the nodeResolve() and commonjs({include: 'node_modules/**'}) plugins
'initializeApp' is not exported by 'node_modules\firebase\app.js'
-
Tried importing from ./node_modules/firebase/firebase-app but being build for the browser I get a navigator error in node
-
I also tried many a few combinations directly in the firebase/app/ folder with browserify to get an intermediate build that would be easier to consume but the build system looks like it was hacked to suit babel.
I understand I am trying to use the database component in a way that is not the intended typical use but I thought that if there were less frictions in just using the firebase toolset it would be much easier to get there progressively.