summaryrefslogtreecommitdiff
path: root/cli/js/compiler_imports.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-03-03 08:18:27 +1100
committerGitHub <noreply@github.com>2020-03-02 22:18:27 +0100
commit83d902a7803adb0c69fe2c98e692a50dae446db9 (patch)
tree75d15519f15748a0c3d016d0ed4e8f1d8389185d /cli/js/compiler_imports.ts
parenta3c3a56ff71c325ea4807548484023c95ffdcd77 (diff)
Fix JavaScript dependencies in bundles. (#4215)
Fixes #4602 We turned off `allowJs` by default, to keep the compiler from grabbing a bunch of files that it wouldn't actually do anything useful with. On the other hand, this caused problems with bundles, where the compiler needs to gather all the dependencies, including JavaScript ones. This fixes this so that when we are bundling, we analyse JavaScript imports in the compiler.
Diffstat (limited to 'cli/js/compiler_imports.ts')
-rw-r--r--cli/js/compiler_imports.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/js/compiler_imports.ts b/cli/js/compiler_imports.ts
index 6e8a6585d..903bcfe4d 100644
--- a/cli/js/compiler_imports.ts
+++ b/cli/js/compiler_imports.ts
@@ -120,7 +120,7 @@ export function processLocalImports(
sources: Record<string, string>,
specifiers: Array<[string, string]>,
referrer?: string,
- checkJs = false
+ processJsImports = false
): string[] {
if (!specifiers.length) {
return [];
@@ -145,9 +145,9 @@ export function processLocalImports(
if (!sourceFile.processed) {
processLocalImports(
sources,
- sourceFile.imports(checkJs),
+ sourceFile.imports(processJsImports),
sourceFile.url,
- checkJs
+ processJsImports
);
}
}
@@ -163,7 +163,7 @@ export function processLocalImports(
export async function processImports(
specifiers: Array<[string, string]>,
referrer?: string,
- checkJs = false
+ processJsImports = false
): Promise<string[]> {
if (!specifiers.length) {
return [];
@@ -179,9 +179,9 @@ export async function processImports(
sourceFile.cache(specifiers[i][0], referrer);
if (!sourceFile.processed) {
await processImports(
- sourceFile.imports(checkJs),
+ sourceFile.imports(processJsImports),
sourceFile.url,
- checkJs
+ processJsImports
);
}
}