Tag: firebase webpack的firebase

webpack只捆绑firebase /数据库而不是firebase / auth

我正在使用我的反应app中的firebase。 我只使用firebase/app和firebase/database模块,所以我只想webpack捆绑我所用的。 但是,webpack捆绑了firebase模块中的所有内容。 我不知道如何告诉webpack忽略其他模块。 我以为我的问题是 import * as firebase from 'firebase'; 不过,我试图只导入一些firebase的东西。 import firebase from 'firebase/app'; import firebase from 'firebase/database'; 但是,webpack仍然捆绑auth.js和其他未使用的模块。 这是我的webpackconfiguration文件。 const path = require('path'); const webpack = require('webpack'); const LodashModuleReplacementPlugin = require('lodash-webpack-plugin'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; module.exports = { cache: true, entry: { main: "./src/swap.tsx", vendor: [ 'babel-polyfill', 'events', 'fbemitter', 'flux', 'react', 'react-dom' […]