-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.config.js
62 lines (61 loc) · 1.7 KB
/
webpack.config.js
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
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
module.exports = {
// merge `production` and `development`, since there is no need to optimize
// frontend packing and we would preserve debug mode for users
mode: "none",
entry: {
index: "./src/index.ts",
},
devtool: "inline-source-map",
devServer: {
static: "./dist",
port: 1234,
},
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
{
test: /\.s[ac]ss|\.css$/i,
use: [
"style-loader", // creates `style` nodes from JS strings
"css-loader", // translates CSS into CommonJS
"sass-loader", // compiles Sass to CSS
],
},
{
test: /\.(woff(2)?|eot|ttf|otf|svg|)$/, // fonts and SVGs
type: "asset/inline",
},
],
},
resolve: {
extensions: [".ts", ".js"],
alias: {
controller: path.resolve(__dirname, "./src/controller"),
data: path.resolve(__dirname, "./src/data"),
display: path.resolve(__dirname, "./src/display"),
widget: path.resolve(__dirname, "./src/widget"),
global: path.resolve(__dirname, "./src/global"),
event: path.resolve(__dirname, "./src/event"),
topbar: path.resolve(__dirname, "./src/topbar"),
timebar: path.resolve(__dirname, "./src/timebar"),
filterbar: path.resolve(__dirname, "./src/filterbar"),
},
},
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "dist"),
// publicPath: "/",
clean: true,
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, "public", "index.html"),
}),
],
};