-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
28 lines (27 loc) · 849 Bytes
/
webpack.config.js
File metadata and controls
28 lines (27 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const path = require("path");
const ErrorOverlayPlugin = require("error-overlay-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const HtmlWebPackPlugin = require("html-webpack-plugin");
const WorkboxPlugin = require("workbox-webpack-plugin");
module.exports = {
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
],
},
plugins: [
new CleanWebpackPlugin(),
new ErrorOverlayPlugin(),
new WorkboxPlugin.GenerateSW({ clientsClaim: true, skipWaiting: true }),
new HtmlWebPackPlugin({ template: "./public/index.html" }),
],
devtool: "cheap-module-source-map",
devServer: { historyApiFallback: true },
output: { filename: "[name].[hash].js", path: path.resolve(__dirname, "dist") },
};