-
-
Notifications
You must be signed in to change notification settings - Fork 114
Remove svelte/ssr resolving #176
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
Conversation
8bc295a
to
68abba8
Compare
we need to update peer dependency on svelte to the version that adds the export map and I hope we can keep the current tests instead of removing them. They should still pass with the new solution |
Svelte 3.43.0 has been released with the new export map entry, so we can now try this out for real. |
aa00043
to
14bef29
Compare
@benmccann We need to update the root We would also want to remove the vite-plugin-svelte/packages/vite-plugin-svelte/src/utils/options.ts Lines 290 to 303 in f112d8b
but we could do it in a separate PR as this should also work as is. The changes in #166 can also be reverted, and refactored a bit to simplify things. |
631d447
to
26f6ca4
Compare
26f6ca4
to
3fe76e4
Compare
@@ -104,25 +101,6 @@ export function svelte(inlineOptions?: Partial<Options>): Plugin { | |||
return importee; // query with svelte tag, an id we generated, no need for further analysis | |||
} | |||
|
|||
if (ssr && importee === 'svelte') { | |||
if (!resolvedSvelteSSR) { | |||
resolvedSvelteSSR = this.resolve('svelte/ssr', undefined, { skipSelf: true }).then( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Vite can't resolve svelte
to the node
exports, I wonder if we should revert this file change, and swap out svelte/ssr
to svelte
, so that we "help" Vite out to resolve it. IIRC this.resolve
, which uses the resolver
plugin has support for exports map, so it should work. But I could completely wrong.
If so, I think we should left using svelte/ssr
at the meantime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benmccann Nevermind, tested this and it doesn't work
79a8ebf
to
3fe76e4
Compare
sveltejs/svelte#6743 is a better solution to this problem