Skip to content

Commit

Permalink
chore: set platform option and remove workaround in environment-react…
Browse files Browse the repository at this point in the history
…-ssr playground
  • Loading branch information
sapphi-red committed Nov 29, 2024
1 parent 5d8fc3c commit 9c57bae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ export function resolveBuildEnvironmentOptions(
...buildEnvironmentOptionsDefaults,
cssCodeSplit: !raw.lib,
minify: consumer === 'server' ? false : 'esbuild',
rollupOptions: {
platform: consumer === 'server' ? 'node' : 'browser',
},
ssr: consumer === 'server',
emitAssets: consumer === 'client',
createEnvironment: (name, config) => new BuildEnvironment(name, config),
Expand Down
5 changes: 0 additions & 5 deletions playground/environment-react-ssr/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ export default defineConfig((env) => ({
input: {
index: '/src/entry-server',
},
output: {
// NOTE: needed for now: https://github.com/rolldown/rolldown/issues/2685
banner:
"import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);",
},
},
},
},
Expand Down

0 comments on commit 9c57bae

Please sign in to comment.