From be804499b03c1288f8c7d926882daa480e843912 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 26 May 2021 14:56:34 -0500 Subject: [PATCH] Remove remote urls from import scanner (#256) * fix: remove remote urls from import scanner * debug test --- packages/astro/src/build.ts | 5 ++++- packages/astro/test/astro-children.test.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/astro/src/build.ts b/packages/astro/src/build.ts index 208072390..f8faf1b77 100644 --- a/packages/astro/src/build.ts +++ b/packages/astro/src/build.ts @@ -248,7 +248,10 @@ export function findDeps(html: string, { astroConfig, srcPath }: { astroConfig: if (!text) return; const [imports] = eslexer.parse(text); for (const spec of imports) { - if (spec.n) pageDeps.js.add(spec.n); + const importSrc = spec.n; + if (importSrc && !isRemote(importSrc)) { + pageDeps.js.add(getDistPath(importSrc, { astroConfig, srcPath })); + } } } }); diff --git a/packages/astro/test/astro-children.test.js b/packages/astro/test/astro-children.test.js index f986887de..bb96a750d 100644 --- a/packages/astro/test/astro-children.test.js +++ b/packages/astro/test/astro-children.test.js @@ -10,6 +10,7 @@ setupBuild(ComponentChildren, './fixtures/astro-children'); ComponentChildren('Passes string children to framework components', async ({ runtime }) => { let result = await runtime.load('/strings'); + console.log(JSON.stringify(result, null, 2)); if (result.error) throw new Error(result); const $ = doc(result.contents);