-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathrspack.config.mjs
More file actions
44 lines (42 loc) · 941 Bytes
/
Copy pathrspack.config.mjs
File metadata and controls
44 lines (42 loc) · 941 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
// @ts-check
import path from "path";
import { rspack } from "@rspack/core";
import { defineConfig } from "@rspack/cli";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
entry: "./src/index.ts",
resolve: {
tsConfig: {
configFile: path.resolve(__dirname, "tsconfig.json"),
},
extensions: ["...", ".ts"],
},
plugins: [
new rspack.HtmlRspackPlugin({
template: "./index.html",
}),
],
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: "builtin:swc-loader",
/**
* @type {import('@rspack/core').SwcLoaderOptions}
*/
options: {
jsc: {
parser: {
syntax: "typescript",
},
},
},
},
],
},
],
},
});