-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
unexpected ?import added to plugin IDs #1655
Comments
Can't reproduce from your repo. I only get two log messages of dependency imports with version queries. The |
Hmm. Can you share the log messages that you get? I didn't quite understand what you're seeing Here's what I get:
It is the first two lines that are meaningful. Thank you for confirming that the |
These are the only logs I got:
Both logs are expected. In fact, I get the Hello World correctly rendering in the browser. |
I see it says "Vite dev server running" in your logs. Did you perhaps I created a |
thanks!! |
Fixed a bunch of other issues, your repo should now run Svelte SSR with beta.39! |
Amazing! Thank you! Would it make any sense for this plugin to live in https://github.com/vitejs/vite/tree/main/packages after I clean it up? Also, you had mentioned earlier that I might need to handle CSS differently than |
Cool! Re package placement: depends on the ownership - putting it inside vite's repo would mean we are committed to maintaining it, which isn't the case, so I think it makes more sense to maybe put it in the Svelte org? Re CSS: during dev, what Vue is doing is generating an import to a virtual module like this: import '/path/to/Component.vue?vue&type=style&lang=.css' The plugin would then check for this request in I think that's kind of what the Svelte plugin is doing but from my previous simple try HMR was not working for CSS, maybe you can figure it out! |
Describe the bug
I have a regex that looks for files ending in
.svelte
as suggested by the documentation here: https://vitejs.dev/guide/api-plugin.html#transforming-custom-file-typesThat regex fails because
?import
is added to the end of files. I believe that the?import
addition is a bug, but it's possible the documentation needs to be updated insteadReproduction
Then visit http://localhost:3000
This will print:
I put debug statements in the plugin here: https://github.com/benmccann/vite-plugin-svelte/blob/be10f3b71f7e440dea8a8b644a15a12c97f0df7d/index.js#L105
You should be able to edit the code in
node_modules/vite-plugin-svelte/index.js
if you want to futz around furtherSystem Info
vite
version: 2.0.0-beta.36The text was updated successfully, but these errors were encountered: