-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.cjs
40 lines (39 loc) · 1.15 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
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
// TODO: Add webpack-merge
console.info("NODE_ENV:", process.env.NODE_ENV);
module.exports = {
mode: "production",
entry: "./src/app/index.ts",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
},
module: {
rules: [
{ test: /\.ts$/i, loader: "swc-loader" },
{ test: /\.html$/i, loader: "html-loader" },
{ test: /\.css$/i, use: ["css-loader", "postcss-loader"] },
],
},
resolve: {
extensions: [".ts", ".js", ".html", ".css"],
alias: {
// FEATURES
"@showcase": path.resolve("src/app/features/showcase"),
"@error": path.resolve("src/app/features/error"),
// CORE
"@core": path.resolve("src/app/core"),
// ADAPTERS
"@adapters": path.resolve("src/app/adapters"),
// MOCK
"@mock": path.resolve("src/mock"),
// TEST
"@test": path.resolve("src/test"),
// PACKAGES
"@packages": path.resolve("src/packages"),
},
},
plugins: [new HtmlWebpackPlugin({ template: "./src/app/index.html" })],
watchOptions: { ignored: /node_modules/ },
};