import * as svelte from 'svelte/compiler'; // @ts-ignore import { createMakeHot } from 'svelte-hmr'; import { safeBase64Hash } from './hash.js'; import { log } from './log.js'; import { checkPreprocessDependencies, createInjectScopeEverythingRulePreprocessorGroup } from './preprocess.js'; import { mapToRelative } from './sourcemaps.js'; import { enhanceCompileError } from './error.js'; import { isSvelte5 } from './svelte-version.js'; // TODO this is a patched version of https://github.com/sveltejs/vite-plugin-svelte/pull/796/files#diff-3bce0b33034aad4b35ca094893671f7e7ddf4d27254ae7b9b0f912027a001b15R10 // 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 = /|