File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 11//@ts -check
2- const { exists, readFileSync } = require ( "fs" ) ;
2+ const { exists, existsSync , readFileSync } = require ( "fs" ) ;
33const path = require ( "path" ) ;
44
55const PrerenderSPAPlugin = require ( "prerender-spa-plugin" ) ;
@@ -17,11 +17,9 @@ function chain(api, projectOptions) {
1717 try {
1818 options = pickle ( projectOptions , CONFIG_OBJ_PATH ) ;
1919 } catch {
20- exists ( "./.prerender-spa.json" , exists => {
21- if ( exists ) {
22- Object . assign ( options , JSON . parse ( readFileSync ( "./.prerender-spa.json" ) . toString ( "utf-8" ) ) ) ;
23- }
24- } ) ;
20+ if ( existsSync ) {
21+ options = JSON . parse ( readFileSync ( "./.prerender-spa.json" ) . toString ( "utf-8" ) ) ;
22+ }
2523 }
2624 if ( options . onlyProduction && process . env . NODE_ENV !== "production" ) {
2725 return ;
You can’t perform that action at this time.
0 commit comments