Skip to content

Commit 256a545

Browse files
committed
chore: simplify
1 parent a5765ed commit 256a545

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

packages/plugin-rsc/examples/basic/vite.config.ts

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,12 @@ export default defineConfig({
2323
plugins: [
2424
tailwindcss(),
2525
process.env.TEST_REACT_COMPILER
26-
? [
27-
react({ babel: { plugins: ['babel-plugin-react-compiler'] } }),
28-
{
29-
name: 'patch-react-transform',
30-
configResolved(config) {
31-
const plugin: any = config.plugins.find(
32-
(p) => p.name === 'vite:react-babel',
33-
)
34-
const original = plugin.transform.handler
35-
plugin.transform.handler = function () {
36-
if (this.environment.name === 'client') {
37-
return original.apply(this, arguments)
38-
}
39-
}
40-
},
41-
},
42-
]
26+
? react({ babel: { plugins: ['babel-plugin-react-compiler'] } }).map(
27+
(p: any) => ({
28+
...p,
29+
applyToEnvironment: (e: any) => e.name === 'client',
30+
}),
31+
)
4332
: react(),
4433
vitePluginUseCache(),
4534
rsc({

0 commit comments

Comments
 (0)