Firebase + webpack


I was able to webpack everything in my angular app (with help from Stanimira Vlaeva on GitHub), but I can’t get the firebase plugin to cooperate. I’m getting firebase is not defined.
Firebase is wrapped in an angular service and I am initializing it in my first component. Solution mentioned here didn’t help me.
I am importing firebase like so:

import firebase = require("nativescript-plugin-firebase");

And using it like so:

export class FirebaseService {
initialize() {    

and in my component this.firebaseService.initialize();

This works fine without AOT, it’s the last thing keeping me from going to production with my app.


@eddy I have also had a lot of trouble with Firebase and webpack. Is there anything obvious holding us back? For me, as I remember, the app would build with webpack but then crash on device, quite hard to debug.


I’m a total webpack noob. Anyone else perhaps?


Importing the plugin this way:
import * as firebase from "nativescript-plugin-firebase"
instead of the way it’s mentioned on github
import firebase = require("nativescript-plugin-firebase");

(Although I was able to webpack the app, I am still a webpack noob, it’s all trial and error for me)