1
- import { bold , dim } from 'https://deno.land/[email protected] /fmt/colors.ts'
1
+ import { dim } from 'https://deno.land/[email protected] /fmt/colors.ts'
2
2
import { indexOf , copy , equals } from 'https://deno.land/[email protected] /bytes/mod.ts'
3
3
import { ensureDir } from 'https://deno.land/[email protected] /fs/ensure_dir.ts'
4
4
import { walk } from 'https://deno.land/[email protected] /fs/walk.ts'
@@ -555,6 +555,7 @@ export class Aleph implements IAleph {
555
555
return null
556
556
}
557
557
558
+ // pre-compile modules to check ssr options
558
559
await Promise . all (
559
560
nestedModules
560
561
. filter ( specifier => ! this . #modules. has ( specifier ) )
@@ -598,7 +599,7 @@ export class Aleph implements IAleph {
598
599
return data
599
600
}
600
601
601
- /** get ssr page */
602
+ /** get page ssr html */
602
603
async getPageHTML ( loc : { pathname : string , search ?: string } ) : Promise < [ number , string ] > {
603
604
const [ router , nestedModules ] = this . #pageRouting. createRouter ( loc )
604
605
const { routePath } = router
@@ -1361,8 +1362,6 @@ export class Aleph implements IAleph {
1361
1362
return
1362
1363
}
1363
1364
1364
- log . info ( bold ( '- Pages (SSG)' ) )
1365
-
1366
1365
// render pages
1367
1366
const paths : Set < { pathname : string , search ?: string } > = new Set ( this . #pageRouting. paths . map ( pathname => ( { pathname } ) ) )
1368
1367
const locales = this . config . locales . filter ( l => l !== this . config . defaultLocale )
@@ -1394,7 +1393,9 @@ export class Aleph implements IAleph {
1394
1393
}
1395
1394
}
1396
1395
}
1397
- await Promise . all ( Array . from ( paths ) . map ( ( loc ) => ( [ loc , ...locales . map ( locale => ( { ...loc , pathname : locale + loc . pathname } ) ) ] ) ) . flat ( ) . map ( async ( { pathname, search } ) => {
1396
+
1397
+ // render route pages
1398
+ await Promise . all ( Array . from ( paths ) . map ( loc => ( [ loc , ...locales . map ( locale => ( { ...loc , pathname : locale + loc . pathname } ) ) ] ) ) . flat ( ) . map ( async ( { pathname, search } ) => {
1398
1399
if ( this . isSSRable ( pathname ) ) {
1399
1400
const [ router , nestedModules ] = this . #pageRouting. createRouter ( { pathname, search } )
1400
1401
if ( router . routePath !== '' ) {
@@ -1412,7 +1413,7 @@ export class Aleph implements IAleph {
1412
1413
)
1413
1414
await ensureTextFile ( dataFile , JSON . stringify ( data ) )
1414
1415
}
1415
- log . info ( ' ○ ', href , dim ( '• ' + util . formatBytes ( html . length ) ) )
1416
+ log . debug ( 'SSR ', href , dim ( '• ' + util . formatBytes ( html . length ) ) )
1416
1417
}
1417
1418
}
1418
1419
} ) )
0 commit comments