@@ -10,7 +10,6 @@ import { pluginLess } from '@rsbuild/plugin-less';
1010import { type RsbuildConfig , mergeRsbuildConfig } from '@rsbuild/core' ;
1111import { SemiRspackPlugin } from '@douyinfe/semi-rspack-plugin' ;
1212import { GLOBAL_ENVS } from '@coze-studio/bot-env-adapter' ;
13- import SubspaceResolvePlugin from '@coze-arch/subspace-resolve-plugin' ;
1413import PkgRootWebpackPlugin from '@coze-arch/pkg-root-webpack-plugin' ;
1514
1615import { formatDefineVars , getLatestGitCommitHash } from './utils' ;
@@ -29,11 +28,10 @@ export function createRsbuildConfig(rsbuildConfig: RsbuildConfig) {
2928 'process.env.SCM_BUILD_TYPE' : process . env . BUILD_TYPE ,
3029 ...GLOBAL_ENVS ,
3130 } ) ,
31+ } ,
32+ resolve : {
33+ dedupe : [ 'react' , 'react-dom' , 'react-router' , 'react-router-dom' ] ,
3234 alias : {
33- 'react-dom' : require . resolve ( 'react-dom' ) ,
34- react : require . resolve ( 'react' ) ,
35- 'react-router-dom' : require . resolve ( 'react-router-dom' ) ,
36- 'react-router' : require . resolve ( 'react-router' ) ,
3735 // fix https://github.com/react-dnd/react-dnd/issues/3433
3836 'react/jsx-runtime.js' : 'react/jsx-runtime' ,
3937 'react/jsx-dev-runtime.js' : 'react/jsx-dev-runtime' ,
@@ -94,7 +92,6 @@ export function createRsbuildConfig(rsbuildConfig: RsbuildConfig) {
9492
9593 appendPlugins ( [
9694 new PkgRootWebpackPlugin ( { } ) ,
97- new SubspaceResolvePlugin ( { currSubspace : 'default' } ) ,
9895 new SemiRspackPlugin ( { theme : '@coze-arch/semi-theme-hand01' } ) ,
9996 ] ) ;
10097
0 commit comments