diff --git a/.changeset/sour-turtles-tap.md b/.changeset/sour-turtles-tap.md new file mode 100644 index 0000000000000..2ec36ecbfd1e1 --- /dev/null +++ b/.changeset/sour-turtles-tap.md @@ -0,0 +1,5 @@ +--- +'@astrojs/svelte': patch +--- + +Update to svelte2tsx 0.6.15 and vite-plugin-svelte 2.4.1 diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index fc9d5aa40354f..a915282778527 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -38,18 +38,18 @@ "dev": "astro-scripts dev \"src/**/*.ts\"" }, "dependencies": { - "@sveltejs/vite-plugin-svelte": "^2.1.1", - "svelte2tsx": "^0.5.11" + "@sveltejs/vite-plugin-svelte": "^2.4.1", + "svelte2tsx": "^0.6.15" }, "devDependencies": { "astro": "workspace:*", "astro-scripts": "workspace:*", - "svelte": "^3.54.0", + "svelte": "^3.55.0", "vite": "^4.3.1" }, "peerDependencies": { "astro": "workspace:^2.6.0", - "svelte": "^3.54.0" + "svelte": "^3.55.0" }, "engines": { "node": ">=16.12.0" diff --git a/packages/integrations/svelte/src/editor.cts b/packages/integrations/svelte/src/editor.cts index c14f082b15056..2d426cf1bbd32 100644 --- a/packages/integrations/svelte/src/editor.cts +++ b/packages/integrations/svelte/src/editor.cts @@ -10,7 +10,7 @@ export function toTSX(code: string, className: string): string { let tsx = svelte2tsx(code, { mode: 'ts' }).code; tsx = '/// \n' + tsx; result = tsx.replace( - 'export default class extends __sveltets_1_createSvelte2TsxComponent(', + 'export default class extends __sveltets_2_createSvelte2TsxComponent(', `export default function ${className}__AstroComponent_(_props: typeof Component.props): any {}\nlet Component = ` ); } catch (e: any) {