0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

[ci] format

This commit is contained in:
matthewp 2023-05-22 13:18:18 +00:00 committed by fredkbot
parent ba06362409
commit f962348f76

View file

@ -55,18 +55,18 @@ export function vitePluginHoistedScripts(
// Find all page entry points and create a map of the entry point to the hashed hoisted script. // Find all page entry points and create a map of the entry point to the hashed hoisted script.
// This is used when we render so that we can add the script to the head. // This is used when we render so that we can add the script to the head.
Object.entries(bundle).forEach(([ id, output ]) => { Object.entries(bundle).forEach(([id, output]) => {
if ( if (
output.type === 'chunk' && output.type === 'chunk' &&
output.facadeModuleId && output.facadeModuleId &&
virtualHoistedEntry(output.facadeModuleId) virtualHoistedEntry(output.facadeModuleId)
) { ) {
considerInlining.set(id, output); considerInlining.set(id, output);
output.imports.forEach(imported => importedByOtherScripts.add(imported)); output.imports.forEach((imported) => importedByOtherScripts.add(imported));
} }
}); });
for (const [ id, output ] of considerInlining.entries()) { for (const [id, output] of considerInlining.entries()) {
const canBeInlined = const canBeInlined =
importedByOtherScripts.has(output.fileName) === false && importedByOtherScripts.has(output.fileName) === false &&
output.imports.length === 0 && output.imports.length === 0 &&
@ -98,7 +98,7 @@ export function vitePluginHoistedScripts(
if (removeFromBundle) { if (removeFromBundle) {
delete bundle[id]; delete bundle[id];
} }
}; }
}, },
}; };
} }