reverse-proxy-frontend/webpack.config.dev.js

54 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-04-14 10:53:19 +03:00
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
process.env.NODE_ENV = "development";
module.exports = {
mode: "development",
target: "web",
devtool: "cheap-module-source-map",
entry: "./src/index",
output: {
path: path.resolve(__dirname, "build"),
publicPath: "/",
filename: "bundle.js"
},
devServer: {
stats: "minimal",
overlay: true,
historyApiFallback: true,
disableHostCheck: true,
headers: { "Access-Control-Allow-Origin": "*" },
https: false
},
plugins: [
new webpack.DefinePlugin({
2020-05-06 10:06:26 +03:00
"process.env.REVERSE_PROXY_API_URL": JSON.stringify(
"http://localhost:5050"
2020-06-07 01:34:52 +03:00
),
"process.env.CHATBOT_API_URL": JSON.stringify("http://localhost:5061")
2020-04-14 10:53:19 +03:00
}),
new HtmlWebpackPlugin({
template: "src/index.html",
favicon: "src/favicon.ico"
2021-05-15 02:03:00 +03:00
}),
new webpack.ProvidePlugin({
process: "process/browser"
2020-04-14 10:53:19 +03:00
})
],
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ["babel-loader", "eslint-loader"]
},
{
test: /(\.css)$/,
use: ["style-loader", "css-loader"]
}
]
}
};