File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed
Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change 1- import fs from 'node:fs'
21import path from 'node:path'
32import type * as http from 'node:http'
43import sirv from 'sirv'
@@ -84,13 +83,6 @@ export async function preview(
8483 'production' ,
8584 )
8685
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-
9486 const app = connect ( ) as Connect . Server
9587 const httpServer = await resolveHttpServer (
9688 config . preview ,
@@ -123,6 +115,7 @@ export async function preview(
123115 config . base === './' || config . base === '' ? '/' : config . base
124116
125117 // static assets
118+ const distDir = path . resolve ( config . root , config . build . outDir )
126119 const headers = config . preview . headers
127120 const assetServer = sirv ( distDir , {
128121 etag : true ,
You can’t perform that action at this time.
0 commit comments