File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ export function build({
6262
6363 fs . writeFileSync ( path . join ( output , 'app.src.js' ) , buildEntry ( { layout } ) ) ;
6464 fs . writeFileSync ( path . join ( output , 'app.data.js' ) , stringifyData ( data ) ) ;
65- fs . copySync ( assets , path . join ( output , 'assets' ) ) ;
65+
66+ assets && fs . copySync ( assets , path . join ( output , 'assets' ) ) ;
6667
6768 buildEntry ( { layout } ) ;
6869 buildPageInfo ( data ) . forEach ( info => {
@@ -140,8 +141,12 @@ export function serve({
140141
141142 const app = express ( ) ;
142143
143- app . get ( '/assets/*' , ( req , res ) => {
144- res . sendFile ( path . join ( assets , req . path . replace ( / ^ \/ a s s e t s \/ / , '' ) ) ) ;
144+ app . get ( '/assets/*' , ( req , res , next ) => {
145+ if ( assets ) {
146+ res . sendFile ( path . join ( assets , req . path . replace ( / ^ \/ a s s e t s \/ / , '' ) ) ) ;
147+ } else {
148+ next ( ) ;
149+ }
145150 } ) ;
146151
147152 app . get ( '*' , ( req , res , next ) => {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export type Page =
1010export type Separator = { type : 'separator' } ;
1111
1212export type Options = {
13- assets : string ,
13+ assets ? : string ,
1414 pages : Array < Page | Separator > | ( ( ) => Array < Page | Separator > ) ,
1515 output : string ,
1616 port ?: number ,
You can’t perform that action at this time.
0 commit comments