Skip to content

Commit 57228ce

Browse files
committed
fix react-in-svelte path bug
1 parent 6d01344 commit 57228ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/svelte/plugin.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ export const sveltrisReactInSvelte = createUnplugin(() => {
1515
},
1616
load(id) {
1717
if (/^sveltris-react-in-svelte.svelte\?path=/.test(id)) {
18+
console.log({ fullId: id, id: id.slice(28) });
1819
return outdent`
1920
<script>
2021
import { onMount, createEventDispatcher, onDestroy, afterUpdate } from 'svelte';
21-
import Component from ${JSON.stringify(id.slice(28))};
22+
import Component from ${JSON.stringify(id.slice(37))};
2223
import React from 'react';
2324
import ReactDOM from 'react-dom/client';
2425

0 commit comments

Comments
 (0)