-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.cjs
87 lines (86 loc) · 2.19 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* eslint-env node */
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
const development = process.env.NODE_ENV === "development";
module.exports = {
devtool: development ? "source-map" : false,
entry: {
compose: "./addon/compose/composeRender.js",
gallery: "./addon/gallery/gallery.jsx",
options: "./addon/options/optionsRender.js",
stub: "./addon/content/stub.js",
background: "./addon/background/background.js",
"dev-frame": "./addon/dev-frame/dev-frame-render.js",
},
mode: "none",
optimization: {
minimize: false,
splitChunks: {
name: false,
chunks: "all",
minChunks: 1,
},
},
output: {
path: path.resolve(__dirname, "dist", "content"),
filename: "[name].bundle.js",
},
plugins: [
new HtmlWebpackPlugin({
hash: false,
template: "./addon/compose/compose.html",
chunks: ["compose"],
filename: "../compose/compose.html",
}),
new HtmlWebpackPlugin({
hash: false,
template: "./addon/gallery/index.html",
chunks: ["gallery"],
filename: "../gallery/index.html",
}),
new HtmlWebpackPlugin({
hash: false,
template: "./addon/options/options.html",
chunks: ["options"],
filename: "../options/options.html",
}),
new HtmlWebpackPlugin({
hash: false,
template: "./addon/content/stub.html",
chunks: ["stub"],
filename: "stub.html",
}),
new HtmlWebpackPlugin({
hash: false,
template: "./addon/content/standalone.html",
chunks: ["stub"],
filename: "standalone.html",
}),
new HtmlWebpackPlugin({
hash: false,
template: "./addon/background/background.html",
chunks: ["background"],
filename: "../background/background.html",
}),
new HtmlWebpackPlugin({
hash: false,
template: "./addon/dev-frame/dev-frame.html",
chunks: ["dev-frame"],
filename: "../dev-frame/dev-frame.html",
}),
],
resolve: {
extensions: [".js", ".jsx"],
},
module: {
rules: [
{
test: /\.m?jsx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
],
},
};