@@ -72,7 +72,6 @@ export class Project {
72
72
} ,
73
73
env : { }
74
74
}
75
- log . info ( colors . bold ( 'Aleph.js' ) )
76
75
this . ready = ( async ( ) => {
77
76
const t = performance . now ( )
78
77
await this . _loadConfig ( )
@@ -417,20 +416,22 @@ export class Project {
417
416
for await ( const { path : p } of walk ( this . srcDir , { includeDirs : false , exts : [ '.js' , '.mjs' , '.ts' , '.json' ] , skip : [ / \. d \. t s $ / i] , maxDepth : 1 } ) ) {
418
417
const name = path . basename ( p )
419
418
if ( name . split ( '.' ) [ 0 ] === 'config' ) {
420
- log . info ( colors . bold ( ' Config' ) )
421
- log . info ( ' ⚙️' , name )
422
- if ( name . endsWith ( '.json' ) ) {
419
+ if ( reModuleExt . test ( name ) ) {
420
+ const { default : conf } = await import ( 'file://' + p )
421
+ if ( util . isPlainObject ( conf ) ) {
422
+ Object . assign ( config , conf )
423
+ Object . assign ( this . config , { __file : name } )
424
+ }
425
+ } else if ( name . endsWith ( '.json' ) ) {
423
426
try {
424
427
const conf = JSON . parse ( await Deno . readTextFile ( p ) )
425
- Object . assign ( config , conf )
428
+ if ( util . isPlainObject ( conf ) ) {
429
+ Object . assign ( config , conf )
430
+ Object . assign ( this . config , { __file : name } )
431
+ }
426
432
} catch ( e ) {
427
433
log . fatal ( 'parse config.json:' , e . message )
428
434
}
429
- } else {
430
- const { default : conf } = await import ( 'file://' + p )
431
- if ( util . isPlainObject ( conf ) ) {
432
- Object . assign ( config , conf )
433
- }
434
435
}
435
436
}
436
437
}
@@ -559,6 +560,11 @@ export class Project {
559
560
const { renderPage, renderHead } = await import ( 'file://' + this . #modules. get ( '//deno.land/x/aleph/renderer.js' ) ! . jsFile )
560
561
this . #renderer = { renderPage, renderHead }
561
562
563
+ log . info ( colors . bold ( 'Aleph.js' ) )
564
+ if ( '__file' in this . config ) {
565
+ log . info ( colors . bold ( ' Config' ) )
566
+ log . info ( ' ⚙️' , this . config [ '__file' ] )
567
+ }
562
568
log . info ( colors . bold ( ' Global' ) )
563
569
if ( this . #modules. has ( '/app.js' ) ) {
564
570
log . info ( ' ✓' , 'Custom App' )
0 commit comments