const HtmlWebpackPlugin = require("html-webpack-plugin"); const path = require("path"); module.exports = { module: { rules: [ { test: /\.(scss|css)$/, use: ["style-loader", "css-loader", "sass-loader"], }, { test: /\.js$/, exclude: /node_modules/, use: ["babel-loader"], }, { test: /\.(png|jpe?g|gif)$/i, loader: "file-loader", options: { outputPath: "img", publicPath: "./img", }, }, ], }, optimization: { splitChunks: { chunks: "all" }, }, plugins: [ new HtmlWebpackPlugin({ template: path.resolve(__dirname, "src", "index.html"), }), ], devServer: { historyApiFallback: true, }, };