首页 > 解决方案 > Webpack + react + firebase 身份验证失败

问题描述

我正在尝试在firebase上进行身份验证。我从关于“react-create-app”的教程中完成了所有工作,并且它有效,但是当我使用 webpack 在项目中制作它时它不起作用。当我尝试登录或注册时,电子邮件和密码只是添加到网址中。在“react-create-app”上它做 POST 请求。我认为我必须配置 webpack。你有什么主意吗?

webpack.config:

const HtmlWebPackPlugin = require("html-webpack-plugin");
const path = require('path');

module.exports = {
    entry: "./src/App.js",
    output: {
        path: path.resolve(__dirname, 'build'),
        filename: 'bundle.js',
        publicPath: '/'
    },
    module: {
        rules: [
            {
                test: /\.(js|jsx)$/,
                exclude: /node_modules/,
                use: ["babel-loader", "eslint-loader"]
            },
            {
                test: /\.scss$/,
                exclude: /node_modules/,
                use: ['style-loader', 'css-loader', 'sass-loader'],
            }
        ]
    },
    devServer: {
        historyApiFallback: true
    },
    plugins: [new HtmlWebPackPlugin({template: "./src/index.html"})]
};

标签: reactjsfirebasewebpack

解决方案


推荐阅读