summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2021-05-26 14:56:34 -0500
committerGravatar GitHub <noreply@github.com> 2021-05-26 14:56:34 -0500
commitbe804499b03c1288f8c7d926882daa480e843912 (patch)
tree17dd2f981866c766e7b0ba976da341a047651e8d
parent5dc3aa007ade6d581474a70363f33422aee58367 (diff)
downloadastro-be804499b03c1288f8c7d926882daa480e843912.tar.gz
astro-be804499b03c1288f8c7d926882daa480e843912.tar.zst
astro-be804499b03c1288f8c7d926882daa480e843912.zip
Remove remote urls from import scanner (#256)
* fix: remove remote urls from import scanner * debug test
-rw-r--r--packages/astro/src/build.ts5
-rw-r--r--packages/astro/test/astro-children.test.js1
2 files changed, 5 insertions, 1 deletions
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);