import { FileFsRef , BuildOptions , shouldServe as defaultShouldServe , ShouldServeOptions , } from '@vercel/build-utils' ; import { BuildResult } from './types' ; export const version = 2 ; export function build ( { files , entrypoint , config : { zeroConfig , outputDirectory } , } ) { const path = zeroConfig && outputDirectory ? `${ outputDirectory }/${ entrypoint }` : entrypoint ; return { output : { [ entrypoint ] : files [ path ] as FileFsRef , } , routes : [ ] , watch : [ path ] , } ; } export function shouldServe ( _opts ) { const opts = { ... _opts } ; let { config : { zeroConfig , outputDirectory } , } = opts ; if ( zeroConfig && outputDirectory ) { opts . entrypoint = `${ outputDirectory }/${ opts . entrypoint }` ; opts . requestPath = `${ outputDirectory }/${ opts . requestPath }` ; } return defaultShouldServe ( opts ) ; }