2020-04-10 01:40:11 +03:00
|
|
|
const webpack = require("webpack");
|
|
|
|
const path = require("path");
|
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
|
|
|
|
process.env.NODE_ENV = "developent";
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
node: "development",
|
|
|
|
target: "web",
|
|
|
|
devTools: "cheap-module-source-map",
|
|
|
|
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: [
|
|
|
|
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-10 01:42:32 +03:00
|
|
|
use: ["babel-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
|
|
|
};
|