Closed SoonIter closed 2 months ago
overrided by @rsbuild/plugin-react
fixed by
export default defineConfig({
plugins: [pluginReact({
swcReactOptions: {
runtime: 'classic'
}
})],
tools: {
// swc(config) {
// (((config.jsc ??= {}).transform ??= {}).react ??= {}).runtime =
// 'classic';
// },
},
});
tools.swc
should execute in the final stage just like tools.bundlerChain
and tools.rspack
so pluginSwc should execute after pluginReact?
modernjs has no entry for modifying the options of pluginReact
@chenjiahan cc
This is an order issue, I think we can try to let pluginReact
to use tools.swc
instead of using modifySwcLoaderOptions
This is an order issue, I think we can try to let
pluginReact
to usetools.swc
instead of usingmodifySwcLoaderOptions
I cannot get isDev
usingHMR
in modifyRsbuildConfig
😂...
Yes, let me think if there is a better way...
Version
Details
rsbuild.config.ts
DEBUG=rsbuild rsbuild build
Reproduce link
https://github.com/SoonIter/rsbuild-tools-swc-issue-repro
Reproduce Steps
https://github.com/web-infra-dev/rsbuild/blob/14c5a9e3bedba919244818792c238a51f2acefe5/packages/core/src/plugins/swc.ts#L158