Skip to content

Commit

Permalink
chore: clarify analyzer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Jan 30, 2023
1 parent 0577e4e commit d556df7
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions packages/astro/src/core/build/vite-plugin-analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d556df7

Please sign in to comment.