florian-lefebvre / astro-integration-kit

A package that contains utilities to help you build Astro integrations.

Home Page:https://astro-integration-kit.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom virtual module/vite plugin resolveId and load options

jdtjenkins opened this issue · comments

At the moment I don't think we'd be able to recreate something like this using the integration kit

https://github.com/lilnasy/gratelets/blob/main/packages/scope/integration.ts

commented

Could you elaborate, which part would be problematic?

I feel like if the logic is a bit beyond basic, using addVitePlugin and a custom logic is fine for now. I mean I'm not against updating the utility but at this point, the abstraction is just getting in the way. It's probably better to just do it from scratch. That being said, it could be useful to export some utilities like resolveVirtualModuleId

Sorry all, yknow what I wasn't thinking of addVitePlugin I was thinking of addVirtualImport which only takes a string for a name and a string for data to return. But yes now we have addVitePlugin should be able to handle that just fine

No worries! Better ask than regret not asking, there are no silly questions