My error as per the title is firebase_app__WEBPACK_IMPORTED_MODULE_0__ is not defined
Im using import to declare firebase in LoadModel.js
import firebase from "firebase/app";
import "firebase/analytics";
import "firebase/firestore";
after being bundled by webpack which uses babel-loader the module appears as not defined
npm i firebase has been executed along with every other node module I needed
webpack.config.js
const path = require('path');
const CircularDependencyPlugin = require('circular-dependency-plugin');
module.exports = {
optimization: {
sideEffects: true,
},
entry: './src/scripts/app.js',
output: {
path: __dirname + "/dist",
filename: 'app.bundle.js',
sourceMapFilename: "[name].js.map"
},
mode: 'none',
devtool: "source-map",
module: {
rules: [
{
test: /\.m?js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
plugins: [
new CircularDependencyPlugin({
// exclude detection of files based on a RegExp
exclude: /a\.js|node_modules/,
// include specific files based on a RegExp
include: /src/,
// add errors to webpack instead of warnings
failOnError: true,
// allow import cycles that include an asyncronous import,
// e.g. via import(/* webpackMode: "weak" */ './file.js')
allowAsyncCycles: false,
// set the current working directory for displaying module paths
cwd: process.cwd(),
})
]
};