mirror of
https://github.com/denoland/deno.git
synced 2025-08-17 09:10:25 +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
|
@ -135,6 +135,15 @@ test(async function bundleApiConfig() {
|
|||
assert(!actual.includes(`random`));
|
||||
});
|
||||
|
||||
test(async function bundleApiJsModules() {
|
||||
const [diagnostics, actual] = await bundle("/foo.js", {
|
||||
"/foo.js": `export * from "./bar.js";\n`,
|
||||
"/bar.js": `export const bar = "bar";\n`
|
||||
});
|
||||
assert(diagnostics == null);
|
||||
assert(actual.includes(`System.register("bar",`));
|
||||
});
|
||||
|
||||
test(async function diagnosticsTest() {
|
||||
const [diagnostics] = await compile("/foo.ts", {
|
||||
"/foo.ts": `document.getElementById("foo");`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue