File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- import { readFileSync , readdirSync , unlinkSync } from 'fs'
3+ import { readFileSync , readdirSync , unlinkSync , existsSync } from 'fs'
44import { dirname } from 'path'
55
66/*
@@ -24,7 +24,13 @@ const option = (name) => process.argv.includes(`--${name}`)
2424const dryRun = option ( `dry-run` )
2525const quiet = option ( `quiet` )
2626const wantsSsr = option ( 'ssr' )
27- const manifestPath = argument ( `manifest` , ( ) => wantsSsr ? `./bootstrap/ssr/ssr-manifest.json` : `./public/build/manifest.json` )
27+ const manifestPath = argument ( `manifest` , ( ) => {
28+ if ( ! wantsSsr ) {
29+ return `./public/build/manifest.json`
30+ }
31+
32+ return existsSync ( `./bootstrap/ssr/ssr-manifest.json` ) ? `./bootstrap/ssr/ssr-manifest.json` : `./public/build/manifest.json`
33+ } )
2834const assetsDirectory = argument ( `assets` , ( ) => `${ dirname ( manifestPath ) } /assets` )
2935
3036/*
@@ -46,12 +52,6 @@ const main = () => {
4652
4753 const isSsr = Array . isArray ( manifest [ manifestKeys [ 0 ] ] )
4854
49- if ( wantsSsr && ! isSsr ) {
50- error ( 'Did not find expected SSR manifest.' )
51-
52- process . exit ( 1 )
53- }
54-
5555 isSsr
5656 ? info ( `SSR manifest found.` )
5757 : info ( `Non-SSR manifest found.` )
You can’t perform that action at this time.
0 commit comments