rxc-app/webpack.config.dev.js

48 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-04-10 01:40:11 +03:00
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
2020-04-11 01:08:28 +03:00
process.env.NODE_ENV = "development";
2020-04-10 01:40:11 +03:00
module.exports = {
2020-04-11 01:08:28 +03:00
mode: "development",
2020-04-10 01:40:11 +03:00
target: "web",
2020-04-11 01:08:28 +03:00
devtool: "cheap-module-source-map",
2020-04-10 01:40:11 +03:00
entry: "./src/index",
output: {
path: path.resolve(__dirname, "build"),
publicPath: "/",
2020-04-10 01:42:32 +03:00
filename: "bundle.js"
2020-04-10 01:40:11 +03:00
},
devServer: {
stats: "minimal",
overlay: true,
historyApiFallback: true,
disableHostCheck: true,
headers: { "Access-Control-Allow-Origin": "*" },
2020-04-10 01:42:32 +03:00
https: false
2020-04-10 01:40:11 +03:00
},
plugins: [
2020-04-11 22:09:25 +03:00
new webpack.DefinePlugin({
"process.env.API_URL": JSON.stringify("http://localhost:3001")
}),
2020-04-10 01:40:11 +03:00
new HtmlWebpackPlugin({
template: "src/index.html",
2020-04-10 01:42:32 +03:00
favicon: "src/favicon.ico"
})
2020-04-10 01:40:11 +03:00
],
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
2020-04-11 01:18:45 +03:00
use: ["babel-loader", "eslint-loader"]
2020-04-10 01:40:11 +03:00
},
{
test: /(\.css)$/,
2020-04-10 01:42:32 +03:00
use: ["style-loader", "css-loader"]
}
]
}
2020-04-10 01:40:11 +03:00
};