Modify canonical loading to allow either suffix.js or suffix.ts endings

This commit is contained in:
2022-07-09 11:01:34 -05:00
parent 111ce0bcf9
commit 7d3fde85eb
3 changed files with 11 additions and 9 deletions

View File

@@ -39,9 +39,10 @@ export class Routing extends Unit {
this.logging.verbose('Registering @extollo view engine namespace.')
engine.registerNamespace('extollo', lib().concat('resources', 'views'))
const suffix = `.routes${env('NODE_SCRIPT_SUFFIX', '.js')}`
const jsSuffix = `.routes.js`
const tsSuffix = `.routes.ts`
for await ( const entry of this.path.walk() ) {
if ( !entry.endsWith(suffix) ) {
if ( !entry.endsWith(jsSuffix) && !entry.endsWith(tsSuffix) ) {
this.logging.debug(`Skipping routes file with invalid suffix: ${entry}`)
continue
}