File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed
packages/plugin-rsc/examples/basic Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change 11import assert from 'node:assert'
22import rsc , { transformHoistInlineDirective } from '@vitejs/plugin-rsc'
33import tailwindcss from '@tailwindcss/vite'
4- import react , { type ViteReactPluginApi } from '@vitejs/plugin-react'
4+ import react from '@vitejs/plugin-react'
55import { type Plugin , defineConfig , normalizePath , parseAstAsync } from 'vite'
66import inspect from 'vite-plugin-inspect'
77import path from 'node:path'
@@ -23,20 +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- // skip react compiler in non CSR environments
29- {
30- name : 'react-babel-override' ,
31- api : {
32- reactBabel : ( babelConfig , context ) => {
33- if ( context . ssr ) {
34- babelConfig . plugins = [ ]
35- }
36- } ,
37- } satisfies ViteReactPluginApi ,
38- } ,
39- ]
26+ ? ( react ( {
27+ babel : { plugins : [ 'babel-plugin-react-compiler' ] } ,
28+ } ) . map ( ( p ) => ( {
29+ ...p ,
30+ applyToEnvironment : ( e : any ) => e . name === 'client' ,
31+ } ) ) as any )
4032 : react ( ) ,
4133 vitePluginUseCache ( ) ,
4234 rsc ( {
You can’t perform that action at this time.
0 commit comments