@@ -4,6 +4,7 @@ import path from 'path'
4
4
import type { PluginBuild } from 'esbuild'
5
5
import { build as esbuildBuild } from 'esbuild'
6
6
import type { Manifest as ViteBuildManifest } from 'vite'
7
+ import { build as viteBuild } from 'vite'
7
8
8
9
import {
9
10
getRouteHookBabelPlugins ,
@@ -65,18 +66,18 @@ export const buildFeServer = async ({ verbose, webDir }: BuildOptions = {}) => {
65
66
// Step 1A: Generate the client bundle
66
67
await buildWeb ( { verbose } )
67
68
68
- // TODO (STREAMING) When Streaming is released Vite will be the only bundler,
69
- // so we can switch to a regular import
70
- // @NOTE : Using dynamic import, because vite is still opt-in
71
- const { build : viteBuild } = await import ( 'vite' )
72
-
73
69
// Step 1B: Generate the server output
74
70
await viteBuild ( {
75
71
configFile : viteConfigPath ,
76
72
build : {
77
- // Because we configure the root to be web/src, we need to go up one level
78
73
outDir : rwPaths . web . distServer ,
79
- ssr : rwPaths . web . entryServer ,
74
+ ssr : true , // use boolean, and supply the inputs in rollup options (see Documentation)
75
+ rollupOptions : {
76
+ input : {
77
+ 'entry.server' : rwPaths . web . entryServer ,
78
+ Document : rwPaths . web . document , // We need the document for React's fallback
79
+ } ,
80
+ } ,
80
81
} ,
81
82
envFile : false ,
82
83
logLevel : verbose ? 'info' : 'warn' ,
0 commit comments