diff --git a/examples/react-component-umd/rslib.config.ts b/examples/react-component-umd/rslib.config.ts index 99d083bdb..b5e4971bf 100644 --- a/examples/react-component-umd/rslib.config.ts +++ b/examples/react-component-umd/rslib.config.ts @@ -20,5 +20,12 @@ export default defineConfig({ output: { target: 'web', }, - plugins: [pluginReact(), pluginSass()], + plugins: [ + pluginReact({ + swcReactOptions: { + runtime: 'classic', + }, + }), + pluginSass(), + ], }); diff --git a/examples/react-component-umd/tsconfig.json b/examples/react-component-umd/tsconfig.json index 78ba7070a..2142e121c 100644 --- a/examples/react-component-umd/tsconfig.json +++ b/examples/react-component-umd/tsconfig.json @@ -7,7 +7,7 @@ "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, - "jsx": "react-jsx", + "jsx": "react", "lib": ["DOM", "ESNext"], "moduleResolution": "node", "resolveJsonModule": true, diff --git a/tests/e2e/react-component/package.json b/tests/e2e/react-component/package.json index a1083e0ff..88f379def 100644 --- a/tests/e2e/react-component/package.json +++ b/tests/e2e/react-component/package.json @@ -5,7 +5,9 @@ "scripts": { "dev:bundle": "../../node_modules/.bin/rsbuild dev --environment=bundle", "dev:bundle-false": "../../node_modules/.bin/rsbuild dev --environment=bundleFalse", - "dev:umd": "../../node_modules/.bin/rsbuild dev --environment=umd" + "dev:umd": "pnpm umd:build && pnpm umd:copy && ../../node_modules/.bin/rsbuild dev --environment=umd", + "umd:build": "cd ../../../examples/react-component-umd && pnpm run build", + "umd:copy": "rm -rf ./public && mkdir -p ./public/umd && cp ../../../examples/react-component-umd/dist/umd/index.js ./public/umd/index.js" }, "dependencies": { "@examples/react-component-bundle": "workspace:*", diff --git a/tests/e2e/react-component/rsbuild.config.ts b/tests/e2e/react-component/rsbuild.config.ts index e282fa951..75d709864 100644 --- a/tests/e2e/react-component/rsbuild.config.ts +++ b/tests/e2e/react-component/rsbuild.config.ts @@ -63,5 +63,11 @@ export default defineConfig({ output: { target: 'web', }, - plugins: [pluginReact()], + plugins: [ + pluginReact({ + swcReactOptions: { + runtime: 'classic', + }, + }), + ], });