-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
this.getModuleInfo().code
support in dev
#19674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
this.getModuleInfo().code
support in dev
I stumbled upon the same issue. |
@magne4000 I feel the same, as right now this prevents me from proceeding with the plugin development. Vite team is working on RollDown, that should in theory replace Rollup/eslint combination with a single environment – which, I suspect, in turn will resolve all these incompatibility issues between build & dev environments. Rolldown is already at It's still early, but I guess it's already possible to give it a test-run for smaller non-critical projects. |
Related issue: #15411 |
sapphi-red response on this subject with some insights:
|
Describe the bug
I am building a plugin that prerenders static pages from markdown/react components.
I am programmatically setting the entrypoints, provide the
resolveId
andload
hooks to load the content.In the reproduction code you will see that I first load
load.html
file and then, when Iload
theload.html
I am also trying to loadsome-code?proxy
module and get it's code.In the build mode it works fine. With the dev mode, the
load
for proxy does not return code.While debugging, I have noticed that build mode goes directly to rollup, however, in dev mode there is a
PluginContext
instead.I have pinpointed the execution to the
load
method inside ofPluginContext
. It loads the source-code, however, the last call tothis.getModuleInfo
does not return the code. And the resultingModueInfo
does not contain anything exceptid
and emptymeta
.Reproduction
https://github.com/vladmiller/vite-context-issue
Steps to reproduce
System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: