From 5309d7bda16eeea740c0e1e94b878e8d0f248b82 Mon Sep 17 00:00:00 2001 From: Andreas Fehn Date: Thu, 21 Nov 2024 16:48:15 +0100 Subject: [PATCH] fix: use script lang regex from svelte compiler (#1028) --- .changeset/swift-dolphins-cheat.md | 5 +++++ packages/vite-plugin-svelte/src/utils/compile.js | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/swift-dolphins-cheat.md diff --git a/.changeset/swift-dolphins-cheat.md b/.changeset/swift-dolphins-cheat.md new file mode 100644 index 000000000..2692939c6 --- /dev/null +++ b/.changeset/swift-dolphins-cheat.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/vite-plugin-svelte': patch +--- + +Allow script tags to span multiple lines diff --git a/packages/vite-plugin-svelte/src/utils/compile.js b/packages/vite-plugin-svelte/src/utils/compile.js index 83f2c840d..4c0e524c9 100644 --- a/packages/vite-plugin-svelte/src/utils/compile.js +++ b/packages/vite-plugin-svelte/src/utils/compile.js @@ -14,7 +14,7 @@ import { enhanceCompileError } from './error.js'; // which is closer to the other regexes in at least not falling into commented script // but ideally would be shared exactly with svelte and other tools that use it const scriptLangRE = - /|