fix: hoist reactive imports to the module

pull/12845/head
paoloricciuti 2 years ago
parent c2fb1a6df1
commit 2fedd765e8

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: hoist reactive imports to the module

@ -197,7 +197,7 @@ export function client_component(analysis, options) {
)
);
instance.body.unshift(...state.legacy_reactive_imports);
module.body.unshift(...state.legacy_reactive_imports);
/** @type {ESTree.Statement[]} */
const store_setup = [];

@ -0,0 +1,3 @@
import { test } from '../../test';
export default test({});

@ -0,0 +1,4 @@
<script context="module">
import defaults from './defaults.js';
defaults.id++;
</script>
Loading…
Cancel
Save