-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
44 lines (42 loc) · 994 Bytes
/
Copy pathwebpack.config.ts
File metadata and controls
44 lines (42 loc) · 994 Bytes
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
import path from "node:path";
import { fileURLToPath } from "node:url";
// In Node.js versions prior to native support for import.meta.dirname,
// derive __dirname from import.meta.url.
// (Node 20.11+ supports import.meta.dirname and import.meta.filename.)
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default {
entry: {
app: "./app/App.ts",
worker: "./worker/GeometryWorker.ts",
style: "./css/app.less",
},
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
{
test: /\.less$/i,
use: [
"style-loader",
"css-loader",
"less-loader",
],
},
{
test: /samples\/*\.js/,
type: "asset/inline",
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "build"),
},
};