-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
41 lines (40 loc) · 1 KB
/
Copy pathwebpack.config.js
File metadata and controls
41 lines (40 loc) · 1 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
/** @type {import('webpack').Configuration} */
module.exports = {
mode: "development", // 'development' for debugging, 'production' for production
entry: {
"service-worker": "./src/service-worker/index.ts",
offscreen: "./src/offscreen/index.ts",
scripts: "./src/scripts/index.ts",
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].bundle.js",
},
resolve: {
extensions: [".ts", ".js"],
},
module: {
rules: [
{
test: /\.ts$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
plugins: [
new CleanWebpackPlugin(),
new CopyWebpackPlugin({
patterns: [
{ from: "public", to: "." }, // Copy manifest.json and static files
],
}),
],
devtool: "source-map", // Helps with debugging
watchOptions: {
ignored: /node_modules/,
},
};