flarelabs-net / vite-environment-providers

1 stars 0 forks source link

Ensure that virtual modules are invalidated in custom environments in Remix #3

Closed jamesopstad closed 2 weeks ago

jamesopstad commented 2 weeks ago

Currently virtual modules are only invalidated for the built in environments (client and ssr). The invalidateVirtualModules function needs to be updated to iterate over the environments when invalidating and use the module graph for each environment (viteDevServer.environments[environmentName].moduleGraph) rather than the shared module graph.

https://github.com/remix-run/remix/blob/d781cc3921d11c475ec40ac2afc02a49a22d10fc/packages/remix-dev/vite/plugin.ts#L308.