-
-
Notifications
You must be signed in to change notification settings - Fork 182
/
webpack.config.js
51 lines (48 loc) · 1.42 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
/* --------------------------------------------------------------------------------------------
* Copyright (c) 2024 TypeFox and others.
* Licensed under the MIT License. See LICENSE in the package root for license information.
* ------------------------------------------------------------------------------------------ */
// solve: __dirname is not defined in ES module scope
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const config = {
entry: resolve(__dirname, 'src', 'client', 'main.ts'),
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.ts?$/,
use: ['ts-loader']
}
]
},
experiments: {
outputModule: true
},
output: {
filename: 'main.js',
path: resolve(__dirname, 'dist', 'client'),
module: true,
workerChunkLoading: 'import',
environment: {
dynamicImportInWorker: true
}
},
target: 'web',
resolve: {
extensions: ['.ts', '.js', '.json', '.ttf'],
fallback: {
fs: false,
module: false,
vm: false
}
},
mode: 'development',
devtool: 'source-map'
};
export default config;