Skip to content

Commit b46a647

Browse files
committed
chore: unused
1 parent f771089 commit b46a647

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

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

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff 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-
}

0 commit comments

Comments
 (0)