diff options
Diffstat (limited to 'cli/js/compiler_imports.ts')
-rw-r--r-- | cli/js/compiler_imports.ts | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/cli/js/compiler_imports.ts b/cli/js/compiler_imports.ts index 042c0a1ae..09b2d4ba1 100644 --- a/cli/js/compiler_imports.ts +++ b/cli/js/compiler_imports.ts @@ -120,7 +120,8 @@ function getMediaType(filename: string): MediaType { export function processLocalImports( sources: Record<string, string>, specifiers: Array<[string, string]>, - referrer?: string + referrer?: string, + checkJs = false ): string[] { if (!specifiers.length) { return []; @@ -143,7 +144,12 @@ export function processLocalImports( }); sourceFile.cache(specifiers[i][0], referrer); if (!sourceFile.processed) { - processLocalImports(sources, sourceFile.imports(), sourceFile.url); + processLocalImports( + sources, + sourceFile.imports(checkJs), + sourceFile.url, + checkJs + ); } } return moduleNames; @@ -157,7 +163,8 @@ export function processLocalImports( * that should be actually resolved. */ export async function processImports( specifiers: Array<[string, string]>, - referrer?: string + referrer?: string, + checkJs = false ): Promise<string[]> { if (!specifiers.length) { return []; @@ -172,7 +179,11 @@ export async function processImports( SourceFile.get(sourceFileJson.url) || new SourceFile(sourceFileJson); sourceFile.cache(specifiers[i][0], referrer); if (!sourceFile.processed) { - await processImports(sourceFile.imports(), sourceFile.url); + await processImports( + sourceFile.imports(checkJs), + sourceFile.url, + checkJs + ); } } return resolvedSources; |