File tree Expand file tree Collapse file tree 1 file changed +0
-30
lines changed
packages/plugin-rsc/examples/basic Expand file tree Collapse file tree 1 file changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ export default defineConfig({
2424 tailwindcss ( ) ,
2525 react ( ) ,
2626 vitePluginUseCache ( ) ,
27- vitePluginBrowserOnly ( ) ,
2827 rsc ( {
2928 entries : {
3029 client : './src/client.tsx' ,
@@ -195,32 +194,3 @@ function vitePluginUseCache(): Plugin[] {
195194 } ,
196195 ]
197196}
198-
199- function vitePluginBrowserOnly ( ) : Plugin [ ] {
200- return [
201- {
202- name : 'browser-only-component' ,
203- load ( id , code ) {
204- if ( id . endsWith ( '?browser-only' ) ) {
205- if ( this . environment . name === 'rsc' ) return
206-
207- id = id . slice ( 0 , - '?browser-only' . length )
208- if ( this . environment . name === 'ssr' ) {
209- code
210- // const Test = React.lazy(() => import('./test-browser-only?browser-only'))
211- return `\
212- export default () => {
213- throw new Error('Browser-only component on SSR')
214- };
215- `
216- }
217- if ( this . environment . name === 'client' ) {
218- return `\
219- export { default } from ${ JSON . stringify ( id ) }
220- `
221- }
222- }
223- } ,
224- } ,
225- ]
226- }
You can’t perform that action at this time.
0 commit comments