const webpack = require("webpack"); const path = require("path"); const HtmlWebpackPlugin = require("html-webpack-plugin"); process.env.NODE_ENV = "development"; process.env.PUBLIC_URL = "/rxc-app"; module.exports = { mode: "development", target: "web", devtool: "cheap-module-source-map", entry: "./src/index", output: { path: path.resolve(__dirname, "build"), publicPath: process.env.PUBLIC_URL, filename: "bundle.js" }, devServer: { stats: "minimal", overlay: true, historyApiFallback: true, disableHostCheck: true, headers: { "Access-Control-Allow-Origin": "*" }, https: false }, plugins: [ new webpack.DefinePlugin({ "process.env.API_URL": JSON.stringify("http://localhost:3001/rxc-api"), "process.env.PUBLIC_URL": JSON.stringify(process.env.PUBLIC_URL) }), new HtmlWebpackPlugin({ template: "src/index.html", favicon: "src/favicon.ico" }) ], module: { rules: [ { test: /\.(js|jsx)$/, exclude: /node_modules/, use: ["babel-loader", "eslint-loader"] }, { test: /(\.css)$/, use: ["style-loader", "css-loader"] } ] } };