Skip to content

Commit

Permalink
$mol_build fix no sources error informative
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Feb 1, 2025
1 parent 94089ad commit ddfba1b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions build/build.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ namespace $ {
concater.add( 'function require'+'( path ){ return $node[ path ] }' )
}

if( sources.length === 0 ) return []
if( sources.length === 0 ) return null

const errors = [] as Error[]

Expand Down Expand Up @@ -979,12 +979,22 @@ namespace $ {
$mol_fail_hidden( error )
}

return [ target, targetMap ]
return [ target, targetMap ] as const
}

@ $mol_mem_key
bundleAndRunTestJS( { path , exclude , bundle } : { path : string , exclude : readonly string[] , bundle : string } ) : $mol_file[] {
const [ target , targetMap ] = this.bundle_test_js([ path, exclude, bundle ])
const [ target , targetMap ] = this.bundle_test_js([ path, exclude, bundle ]) ?? []
if (! target || ! targetMap ) {
this.$.$mol_log3_warn({
place: `${this}.bundleAndRunTestJS` ,
message: 'No sources found' ,
hint: 'Wrong path?',
path ,
})
return []
}

if( bundle === 'node' ) {
const dir = this.root().path()

Expand Down

0 comments on commit ddfba1b

Please sign in to comment.