@sveltejs/vite-plugin-svelte 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/vite-plugin-svelte",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "license": "MIT",
5
5
  "author": "dominikg",
6
6
  "files": [
package/src/index.js CHANGED
@@ -298,7 +298,7 @@ export function svelte(inlineOptions) {
298
298
  try {
299
299
  // @ts-ignore doesn't exist in Svelte 4
300
300
  const compileResult = await svelteCompiler.compileModule(code, {
301
- generate: isSvelte5 ? (ssr ? 'server' : 'client') : ssr ? 'ssr' : 'dom',
301
+ generate: ssr ? 'server' : 'client',
302
302
  filename: moduleRequest.filename
303
303
  });
304
304
  logCompilerWarnings(moduleRequest, compileResult.warnings, options);
@@ -7,7 +7,8 @@ import { log } from './log.js';
7
7
  import { createInjectScopeEverythingRulePreprocessorGroup } from './preprocess.js';
8
8
  import { mapToRelative } from './sourcemaps.js';
9
9
 
10
- const scriptLangRE = /<script [^>]*lang=["']?([^"' >]+)["']?[^>]*>/;
10
+ const scriptLangRE =
11
+ /<script (?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=["']?([^"' >]+)["']?[^>]*>/;
11
12
 
12
13
  import { isSvelte3, isSvelte5 } from './svelte-version.js';
13
14
 
@@ -65,8 +65,7 @@ async function compileSvelte(options, { filename, code }, statsCollection) {
65
65
  // @ts-ignore doesn't exist in Svelte 4
66
66
  const compiled = svelte.compileModule(code, {
67
67
  filename,
68
- generate: isSvelte5 ? 'client' : 'dom',
69
- runes: true
68
+ generate: 'client'
70
69
  });
71
70
  if (endStat) {
72
71
  endStat();