-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsbuild.config.ts
37 lines (36 loc) · 1007 Bytes
/
rsbuild.config.ts
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
import { defineConfig } from '@rsbuild/core';
import { pluginBabel } from '@rsbuild/plugin-babel';
import { pluginEslint } from '@rsbuild/plugin-eslint';
import { pluginReact } from '@rsbuild/plugin-react';
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
export default defineConfig({
plugins: [
pluginReact(),
pluginEslint({
enable: true,
eslintPluginOptions: {
exclude: ['node_modules', 'dist'],
cwd: __dirname,
configType: 'flat',
},
}),
pluginBabel({
include: /\.(?:jsx|tsx)$/,
babelLoaderOptions(opts) {
opts.plugins?.unshift('babel-plugin-react-compiler');
},
}),
],
tools: {
rspack(config, { appendPlugins }) {
// Only register the plugin when RSDOCTOR is true, as the plugin will increase the build time.
if (process.env.RSDOCTOR) {
appendPlugins(
new RsdoctorRspackPlugin({
// plugin options
}),
);
}
},
},
});