-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathrspack.config.mjs
More file actions
50 lines (48 loc) · 1010 Bytes
/
rspack.config.mjs
File metadata and controls
50 lines (48 loc) · 1010 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
45
46
47
48
49
50
// @ts-check
import { defineConfig } from '@rspack/cli';
import { RunScriptWebpackPlugin } from 'run-script-webpack-plugin';
/** @type {import('@rspack/cli').Configuration} */
export default defineConfig({
context: import.meta.dirname,
target: 'node',
entry: {
main: ['@rspack/core/hot/poll?100', './src/main.ts'],
},
resolve: {
extensions: ['...', '.ts', '.tsx', '.jsx'],
},
module: {
rules: [
{
test: /\.ts$/,
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
decorators: true,
},
},
},
},
},
],
},
optimization: {
minimize: false,
},
externalsType: 'commonjs',
plugins: [
!process.env.BUILD &&
new RunScriptWebpackPlugin({
name: 'main.js',
autoRestart: false,
}),
],
devServer: {
devMiddleware: {
writeToDisk: true,
},
},
});