You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the compile function from svelte/compiler with the sveltePath option, the generated JS source does not apply the provided path to all the Svelte imports.
For example, the following Svelte source:
<script>
import { onDestroy } from 'svelte';
</script>
will result in:
/* generated by Svelte v3.43.1 */
import { SvelteComponent, init, safe_not_equal } from "/my/path/svelte/internal";
import { onDestroy } from 'svelte';
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, null, safe_not_equal, {});
}
}
export default Component;
As we can see, onDestroy is imported from svelte and not from /my/path/svelte.
Describe the bug
When using the
compile
function fromsvelte/compiler
with thesveltePath
option, the generated JS source does not apply the provided path to all the Svelte imports.For example, the following Svelte source:
will result in:
As we can see,
onDestroy
is imported fromsvelte
and not from/my/path/svelte
.After digging a bit, it seems the bug appears with svelte@3.39 (3.38.3 was fine), and I suspect it is caused by this commit c550f60#diff-d45b1ba306d2b3502800078a886e7ad894d1828144409e58bf035bee8767b387 but I haven't ben able to identify the exact problem.
Reproduction
Create test.js like this:
and run
node test.js
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: