diff --git a/core/loader/src/LoaderUtil.ts b/core/loader/src/LoaderUtil.ts index 6f281a45..8cfcf0a6 100644 --- a/core/loader/src/LoaderUtil.ts +++ b/core/loader/src/LoaderUtil.ts @@ -9,8 +9,6 @@ const Module = module.constructor.length > 1 /* istanbul ignore next */ : BuiltinModule; -const EXTENSION = Object.keys((Module as any)._extensions).find(t => t === '.ts') ? '.ts' : '.js'; - interface LoaderUtilConfig { extraFilePattern?: string[]; } @@ -21,7 +19,9 @@ export class LoaderUtil { this.config = config; } - static extension = EXTENSION; + static get extension() { + return Object.keys((Module as any)._extensions).find(t => t === '.ts') ? '.ts' : '.js'; + } static filePattern(): string[] { const extensions = Object.keys((Module as any)._extensions);