-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
- P2: nice to haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Description
What version of astro
are you using?
2.8.3
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Linux
What browser are you using?
Firefox
Describe the Bug
When components are re-exported, like so:
import Component from './Component.astro';
import Layout from './Layout.astro';
export { Component, Layout };
Astro loses track of which components are included on which pages, leading to hoisted scripts being included on a page where the component does not exist.
This is impactful on a monorepo that includes a library of Astro components, as there is no easy way to avoid re-exporting them.
What's the expected result?
Re-exporting components should function identically to importing them directly.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-15jfdd?file=src%2Fpages%2Findex.astro
Participation
- I am willing to submit a pull request for this issue.
delucis
Metadata
Metadata
Assignees
Labels
- P2: nice to haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)