@sveltejs/vite-plugin-svelte 4.0.0-next.7 → 4.0.0
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 +8 -8
- package/src/index.js +1 -0
- package/src/preprocess.js +1 -0
- package/src/public.d.ts +4 -0
- package/src/utils/hash.js +1 -1
- package/src/utils/id.js +3 -2
- package/src/utils/load-svelte-config.js +1 -0
- package/src/utils/log.js +14 -2
- package/src/utils/options.js +1 -0
- package/src/utils/sourcemaps.js +1 -0
- package/types/index.d.ts +4 -0
- package/types/index.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/vite-plugin-svelte",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "dominikg",
|
|
6
6
|
"files": [
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"homepage": "https://github.com/sveltejs/vite-plugin-svelte#readme",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@sveltejs/vite-plugin-svelte-inspector": "^3.0.0-next.0||^3.0.0",
|
|
40
|
-
"debug": "^4.3.
|
|
40
|
+
"debug": "^4.3.7",
|
|
41
41
|
"deepmerge": "^4.3.1",
|
|
42
42
|
"kleur": "^4.1.5",
|
|
43
|
-
"magic-string": "^0.30.
|
|
44
|
-
"vitefu": "^1.0.
|
|
43
|
+
"magic-string": "^0.30.12",
|
|
44
|
+
"vitefu": "^1.0.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"svelte": "^5.0.0-next.96 || ^5.0.0",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/debug": "^4.1.12",
|
|
52
|
-
"esbuild": "^0.
|
|
53
|
-
"sass": "^1.
|
|
54
|
-
"svelte": "^5.0.0-next.
|
|
55
|
-
"vite": "^5.4.
|
|
52
|
+
"esbuild": "^0.24.0",
|
|
53
|
+
"sass": "^1.79.5",
|
|
54
|
+
"svelte": "^5.0.0-next.268",
|
|
55
|
+
"vite": "^5.4.9"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"check:publint": "publint --strict",
|
package/src/index.js
CHANGED
package/src/preprocess.js
CHANGED
package/src/public.d.ts
CHANGED
|
@@ -136,6 +136,9 @@ export interface SvelteConfig {
|
|
|
136
136
|
/**
|
|
137
137
|
* Handles warning emitted from the Svelte compiler
|
|
138
138
|
*
|
|
139
|
+
* warnings emitted for files in node_modules are logged at the debug level, to see them run
|
|
140
|
+
* `DEBUG=vite-plugin-svelte:node-modules-onwarn pnpm build`
|
|
141
|
+
*
|
|
139
142
|
* @example
|
|
140
143
|
* ```
|
|
141
144
|
* (warning, defaultHandler) => {
|
|
@@ -145,6 +148,7 @@ export interface SvelteConfig {
|
|
|
145
148
|
* }
|
|
146
149
|
* }
|
|
147
150
|
* ```
|
|
151
|
+
*
|
|
148
152
|
*/
|
|
149
153
|
onwarn?: (warning: Warning, defaultHandler: (warning: Warning) => void) => void;
|
|
150
154
|
/**
|
package/src/utils/hash.js
CHANGED
package/src/utils/id.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createFilter, normalizePath } from 'vite';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import process from 'node:process';
|
|
4
5
|
import { log } from './log.js';
|
|
5
6
|
import { DEFAULT_SVELTE_MODULE_EXT, DEFAULT_SVELTE_MODULE_INFIX } from './constants.js';
|
|
6
7
|
|
package/src/utils/log.js
CHANGED
|
@@ -226,14 +226,26 @@ function buildExtraWarnings(warnings, isBuild) {
|
|
|
226
226
|
* @param {import('svelte/compiler').Warning} w
|
|
227
227
|
*/
|
|
228
228
|
function warnDev(w) {
|
|
229
|
-
if (
|
|
229
|
+
if (w.filename?.includes('node_modules')) {
|
|
230
|
+
if (isDebugNamespaceEnabled('node-modules-onwarn')) {
|
|
231
|
+
log.debug(buildExtendedLogMessage(w), undefined, 'node-modules-onwarn');
|
|
232
|
+
}
|
|
233
|
+
} else if (log.info.enabled) {
|
|
234
|
+
log.info(buildExtendedLogMessage(w));
|
|
235
|
+
}
|
|
230
236
|
}
|
|
231
237
|
|
|
232
238
|
/**
|
|
233
239
|
* @param {import('svelte/compiler').Warning & {frame?: string}} w
|
|
234
240
|
*/
|
|
235
241
|
function warnBuild(w) {
|
|
236
|
-
if (
|
|
242
|
+
if (w.filename?.includes('node_modules')) {
|
|
243
|
+
if (isDebugNamespaceEnabled('node-modules-onwarn')) {
|
|
244
|
+
log.debug(buildExtendedLogMessage(w), w.frame, 'node-modules-onwarn');
|
|
245
|
+
}
|
|
246
|
+
} else if (log.warn.enabled) {
|
|
247
|
+
log.warn(buildExtendedLogMessage(w), w.frame);
|
|
248
|
+
}
|
|
237
249
|
}
|
|
238
250
|
|
|
239
251
|
/**
|
package/src/utils/options.js
CHANGED
package/src/utils/sourcemaps.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -136,6 +136,9 @@ declare module '@sveltejs/vite-plugin-svelte' {
|
|
|
136
136
|
/**
|
|
137
137
|
* Handles warning emitted from the Svelte compiler
|
|
138
138
|
*
|
|
139
|
+
* warnings emitted for files in node_modules are logged at the debug level, to see them run
|
|
140
|
+
* `DEBUG=vite-plugin-svelte:node-modules-onwarn pnpm build`
|
|
141
|
+
*
|
|
139
142
|
* @example
|
|
140
143
|
* ```
|
|
141
144
|
* (warning, defaultHandler) => {
|
|
@@ -145,6 +148,7 @@ declare module '@sveltejs/vite-plugin-svelte' {
|
|
|
145
148
|
* }
|
|
146
149
|
* }
|
|
147
150
|
* ```
|
|
151
|
+
*
|
|
148
152
|
*/
|
|
149
153
|
onwarn?: (warning: Warning, defaultHandler: (warning: Warning) => void) => void;
|
|
150
154
|
/**
|
package/types/index.d.ts.map
CHANGED
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
null,
|
|
23
23
|
null
|
|
24
24
|
],
|
|
25
|
-
"mappings": ";;;;aAIYA,OAAOA;;;;;;;;;;;;;kBAaFC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGbC,YAAYA
|
|
25
|
+
"mappings": ";;;;aAIYA,OAAOA;;;;;;;;;;;;;kBAaFC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGbC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFZC,qBAAqBA;;;;;;;;;;;;;iBC1KtBC,MAAMA;iBCTNC,cAAcA;iBCgBRC,gBAAgBA"
|
|
26
26
|
}
|