Skip to content

Commit 9c57bae

Browse files
committed
chore: set platform option and remove workaround in environment-react-ssr playground
1 parent 5d8fc3c commit 9c57bae

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/vite/src/node/build.ts

+3
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ export function resolveBuildEnvironmentOptions(
419419
...buildEnvironmentOptionsDefaults,
420420
cssCodeSplit: !raw.lib,
421421
minify: consumer === 'server' ? false : 'esbuild',
422+
rollupOptions: {
423+
platform: consumer === 'server' ? 'node' : 'browser',
424+
},
422425
ssr: consumer === 'server',
423426
emitAssets: consumer === 'client',
424427
createEnvironment: (name, config) => new BuildEnvironment(name, config),

playground/environment-react-ssr/vite.config.ts

-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ export default defineConfig((env) => ({
4747
input: {
4848
index: '/src/entry-server',
4949
},
50-
output: {
51-
// NOTE: needed for now: https://github.com/rolldown/rolldown/issues/2685
52-
banner:
53-
"import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);",
54-
},
5550
},
5651
},
5752
},

0 commit comments

Comments
 (0)