-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathwebpack.config.cjs
64 lines (63 loc) · 1.46 KB
/
webpack.config.cjs
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const CopyWebpackPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
mode: "development",
entry: {
background: "./src/background/index.ts",
fill_password: "./src/background/fill-password.ts",
content_script: "./src/background/content-script.ts",
settings: "./src/ui/settings/index.tsx",
popup: "./src/ui/popup/index.tsx",
in_page: "./src/ui/in-page/index.tsx",
},
resolve: {
extensions: [".tsx", ".ts", ".jsx", ".js"],
fallback: {
crypto: false,
},
},
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
{
test: /\.s[ac]ss$/,
use: ["style-loader", "css-loader", "sass-loader"],
},
],
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: "./meta",
},
{
from: "./LICENSE",
},
],
}),
new HtmlWebpackPlugin({
template: "./src/ui/index.html",
filename: "./settings.html",
inject: "body",
chunks: ["settings"],
}),
new HtmlWebpackPlugin({
template: "./src/ui/index.html",
filename: "./popup.html",
inject: "body",
chunks: ["popup"],
}),
new HtmlWebpackPlugin({
template: "./src/ui/index.html",
filename: "./in_page.html",
inject: "body",
chunks: ["in_page"],
}),
],
devtool: "source-map",
};