@sveltejs/vite-plugin-svelte 2.4.1 → 2.4.2

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.4.1",
3
+ "version": "2.4.2",
4
4
  "license": "MIT",
5
5
  "author": "dominikg",
6
6
  "files": [
@@ -38,19 +38,19 @@
38
38
  "deepmerge": "^4.3.1",
39
39
  "kleur": "^4.1.5",
40
40
  "magic-string": "^0.30.0",
41
- "svelte-hmr": "^0.15.1",
41
+ "svelte-hmr": "^0.15.2",
42
42
  "vitefu": "^0.2.4",
43
- "@sveltejs/vite-plugin-svelte-inspector": "^1.0.2"
43
+ "@sveltejs/vite-plugin-svelte-inspector": "^1.0.3"
44
44
  },
45
45
  "peerDependencies": {
46
- "svelte": "^3.54.0 || ^4.0.0-next.0",
46
+ "svelte": "^3.54.0 || ^4.0.0",
47
47
  "vite": "^4.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/debug": "^4.1.7",
51
- "esbuild": "^0.17.18",
52
- "svelte": "^3.59.1",
53
- "vite": "^4.3.5"
50
+ "@types/debug": "^4.1.8",
51
+ "esbuild": "^0.18.6",
52
+ "svelte": "^3.59.2",
53
+ "vite": "^4.3.9"
54
54
  },
55
55
  "scripts": {
56
56
  "check:publint": "publint --strict",
@@ -125,13 +125,15 @@ export const _createCompileSvelte = (makeHot) => {
125
125
  const endStat = stats?.start(filename);
126
126
  const compiled = compile(finalCode, finalCompileOptions);
127
127
 
128
- // prevent dangling pure comments
129
- // see https://github.com/sveltejs/kit/issues/9492#issuecomment-1487704985
130
- // uses regex replace with whitespace to keep sourcemap/character count unmodified
131
- compiled.js.code = compiled.js.code.replace(
132
- /\/\* [@#]__PURE__ \*\/(\s*)$/gm,
133
- ' $1'
134
- );
128
+ if (isSvelte3) {
129
+ // prevent dangling pure comments
130
+ // see https://github.com/sveltejs/kit/issues/9492#issuecomment-1487704985
131
+ // uses regex replace with whitespace to keep sourcemap/character count unmodified
132
+ compiled.js.code = compiled.js.code.replace(
133
+ /\/\* [@#]__PURE__ \*\/(\s*)$/gm,
134
+ ' $1'
135
+ );
136
+ }
135
137
  if (endStat) {
136
138
  endStat();
137
139
  }