File tree 1 file changed +1
-8
lines changed
1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change 1
- import fs from 'node:fs'
2
1
import path from 'node:path'
3
2
import type * as http from 'node:http'
4
3
import sirv from 'sirv'
@@ -84,13 +83,6 @@ export async function preview(
84
83
'production' ,
85
84
)
86
85
87
- const distDir = path . resolve ( config . root , config . build . outDir )
88
- if ( ! fs . existsSync ( distDir ) ) {
89
- throw new Error (
90
- `"${ config . build . outDir } " does not exist. Did you build your project?` ,
91
- )
92
- }
93
-
94
86
const app = connect ( ) as Connect . Server
95
87
const httpServer = await resolveHttpServer (
96
88
config . preview ,
@@ -123,6 +115,7 @@ export async function preview(
123
115
config . base === './' || config . base === '' ? '/' : config . base
124
116
125
117
// static assets
118
+ const distDir = path . resolve ( config . root , config . build . outDir )
126
119
const headers = config . preview . headers
127
120
const assetServer = sirv ( distDir , {
128
121
etag : true ,
You can’t perform that action at this time.
0 commit comments