Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

It doesn't work with SSG #1

Open
antoninadert opened this issue Mar 1, 2023 · 1 comment
Open

It doesn't work with SSG #1

antoninadert opened this issue Mar 1, 2023 · 1 comment

Comments

@antoninadert
Copy link

antoninadert commented Mar 1, 2023

When using the auto-imports with SSG, it is impossible to run npm run build without this error : RollupError: Could not resolve "./src/components/Header.astro" from "src/layouts/BaseLayout.astro"

This is because at build time, the paths seem to be relative to the path of the current file.
In this example BaseLayout imports Headerfrom /src/layouts/src/components/Header.astro
Problem is that ./ refers to ./src/layouts instead of / like expected.

I don't really know how to make it work (not a dev myself).
Your help appreciated.

Thanks for the library

PS : The same components and layouts display fine when doing npm run dev

@arstnei0
Copy link
Owner

arstnei0 commented Mar 2, 2023

I am so sorry that I have no idea how to solve that.
TBH I stopped maintaining this lib for quite a long time. I'm not even using it myself for my Astro projects as I also encountered a bunch of problems too. Plugins are hard and they are quite mysterious as Vite uses different logic for dev and build. Thank you for using my lib anyway!

I love auto import. However sometimes auto imports are just messing my codebase and making it unpredictable. This lib is more like a practice for myself to create a Astro plugin.

I should probably archive this repo now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants