You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if I use astro-embed-integration in astro.config.mjs it will inject itself (CSS and JS) post compiling to every MDX file, even if there aren't any embeds in the MDX.
I propose to check for every file which would got embeds and inject proper astro-embed plugin for each of them
The text was updated successfully, but these errors were encountered:
delucis
changed the title
(SSG) astro-embed-integration should inject itself only when MDX has embeds
Only inject imports for components actually used in MDX
Apr 4, 2024
Transferred this across from https://github.com/delucis/astro-embed as this functionality, if ever implemented, would likely need to be implemented here in astro-auto-import.
I haven’t looked into if this is possible reliably. Perhaps if we could enforce somehow a plugin to run last, it could check the final AST for references and only add import statements for the imports that are needed. Doing it earlier would mean astro-auto-import could miss component usage added by later plugins.
Currently if I use
astro-embed-integration
inastro.config.mjs
it will inject itself (CSS and JS) post compiling to every MDX file, even if there aren't any embeds in the MDX.I propose to check for every file which would got embeds and inject proper
astro-embed
plugin for each of themThe text was updated successfully, but these errors were encountered: