From d556df728d3002a207a0e1f9531aa1a15062b544 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 30 Jan 2023 15:11:45 -0500 Subject: [PATCH] chore: clarify analyzer comments --- .../astro/src/core/build/vite-plugin-analyzer.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/astro/src/core/build/vite-plugin-analyzer.ts b/packages/astro/src/core/build/vite-plugin-analyzer.ts index 1aff465c1..0ba6c30eb 100644 --- a/packages/astro/src/core/build/vite-plugin-analyzer.ts +++ b/packages/astro/src/core/build/vite-plugin-analyzer.ts @@ -89,22 +89,13 @@ export function vitePluginAnalyzer(internals: BuildInternals): VitePlugin { } internals.discoveredScripts.add(moduleId); + // TODO: map raw URL (?type=script) to client build ready URL + // This will inject the raw URL as a script tag as-is, + // which will fail to map with the client build output. pageData.propagatedScripts = propagatedMapByImporter; // Add propagated scripts to client build, // but DON'T add to pages -> hoisted script map. - // const flattenedPropagatedScripts = Array.from(propagatedMapByImporter.values()) - // .map((s) => Array.from(s)) - // .flat(); - // const uniquePropagatedId = JSON.stringify(flattenedPropagatedScripts.sort()); - // if (uniqueHoistedIds.has(uniquePropagatedId)) { - // moduleId = uniqueHoistedIds.get(uniquePropagatedId)!; - // } else { - // // Otherwise, create a unique id for this set of hoisted scripts - // moduleId = `/astro/hoisted.js?q=${uniqueHoistedIds.size}`; - // console.log('uniquePropagatedId', uniquePropagatedId, moduleId); - // uniqueHoistedIds.set(uniquePropagatedId, moduleId); - // } for (const propagatedScripts of propagatedMapByImporter.values()) { for (const propagatedScript of propagatedScripts) { internals.discoveredScripts.add(propagatedScript);