As raised over two years ago in this Github issue, unused components are brought into pages even when not imported. Here's a minimal reproducible example (linked from that issue): notice how the console log message from the Test.astro component runs on the index page even though it's not imported or used. Also, the Card component is commented out but it's still working (but shouldn't!). I'm creating a project with Astro and am facing major headaches with this seeming to be the root cause. This is inefficient, confusing, and unusable on many projects.
I love Astro and want it to succeed, but this is really a breaking bug that needs to be fixed. Am I missing something? I haven't found much discussion beyond that issue, so I would love to know if I'm doing something wrong and to see if others have noticed this.