-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.cjs
68 lines (67 loc) · 1.77 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
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.mjs",
gallery: "./addon/gallery/gallery.mjs",
options: "./addon/options/optionsRender.mjs",
stub: "./addon/content/stub.mjs",
"dev-frame": "./addon/dev-frame/dev-frame-render.mjs",
},
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/dev-frame/dev-frame.html",
chunks: ["dev-frame"],
filename: "../dev-frame/dev-frame.html",
}),
],
resolve: {
extensions: [".js", ".mjs"],
},
};