mirror of
https://github.com/denoland/deno.git
synced 2025-09-25 19:59:16 +00:00
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.
This commit is contained in:
parent
a3c3a56ff7
commit
83d902a780
6 changed files with 84 additions and 25 deletions
|
@ -91,7 +91,7 @@ export class SourceFile {
|
|||
}
|
||||
|
||||
/** Process the imports for the file and return them. */
|
||||
imports(checkJs: boolean): Array<[string, string]> {
|
||||
imports(processJsImports: boolean): Array<[string, string]> {
|
||||
if (this.processed) {
|
||||
throw new Error("SourceFile has already been processed.");
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ export class SourceFile {
|
|||
}
|
||||
} else if (
|
||||
!(
|
||||
!checkJs &&
|
||||
!processJsImports &&
|
||||
(this.mediaType === MediaType.JavaScript ||
|
||||
this.mediaType === MediaType.JSX)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue