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.API_URL": JSON.stringify("http://localhost:3001"),
|
|
|
|
"process.env.REVERSE_PROXY_API_URL": JSON.stringify(
|
|
|
|
"http://localhost:5050"
|
|
|
|
)
|
2020-04-14 10:53:19 +03:00
|
|
|
}),
|
|
|
|
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"]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|