@sveltejs/vite-plugin-svelte 6.1.3 → 6.1.4

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": "6.1.3",
3
+ "version": "6.1.4",
4
4
  "license": "MIT",
5
5
  "author": "dominikg",
6
6
  "files": [
@@ -37,7 +37,6 @@
37
37
  "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0",
38
38
  "debug": "^4.4.1",
39
39
  "deepmerge": "^4.3.1",
40
- "kleur": "^4.1.5",
41
40
  "magic-string": "^0.30.17",
42
41
  "vitefu": "^1.1.1"
43
42
  },
@@ -47,9 +46,9 @@
47
46
  },
48
47
  "devDependencies": {
49
48
  "@types/debug": "^4.1.12",
50
- "sass": "^1.90.0",
51
- "svelte": "^5.38.2",
52
- "vite": "^7.1.2"
49
+ "sass": "^1.91.0",
50
+ "svelte": "^5.38.6",
51
+ "vite": "^7.1.4"
53
52
  },
54
53
  "scripts": {
55
54
  "check:publint": "publint --strict",
@@ -31,18 +31,21 @@ export function preprocess(api) {
31
31
  name: 'vite-plugin-svelte:preprocess',
32
32
  enforce: 'pre',
33
33
  configResolved(c) {
34
- //@ts-expect-error defined below but filter not in type
35
- plugin.transform.filter = api.filter;
36
34
  options = api.options;
37
35
  if (arraify(options.preprocess).length > 0) {
38
36
  preprocessSvelte = createPreprocessSvelte(options, c);
37
+ // @ts-expect-error defined below but filter not in type
38
+ plugin.transform.filter = api.filter;
39
39
  } else {
40
40
  log.debug(
41
41
  `disabling ${plugin.name} because no preprocessor is configured`,
42
42
  undefined,
43
43
  'preprocess'
44
44
  );
45
- delete plugin.transform;
45
+ // @ts-expect-error force set undefined to clear memory
46
+ preprocessSvelte = undefined;
47
+ // @ts-expect-error defined below but filter not in type
48
+ plugin.transform.filter = { id: /$./ }; // never match
46
49
  }
47
50
  },
48
51
  configureServer(server) {
package/src/public.d.ts CHANGED
@@ -121,7 +121,7 @@ export interface SvelteConfig {
121
121
  /**
122
122
  * An array of preprocessors to transform the Svelte source code before compilation
123
123
  *
124
- * @see https://svelte.dev/docs#svelte_preprocess
124
+ * @see https://svelte.dev/docs/svelte/svelte-compiler#PreprocessorGroup
125
125
  */
126
126
  preprocess?: Arrayable<PreprocessorGroup>;
127
127
  /**
@@ -129,7 +129,7 @@ export interface SvelteConfig {
129
129
  * including `dev` and `css`. However, some options are non-configurable, like
130
130
  * `filename`, `format`, `generate`, and `cssHash` (in dev).
131
131
  *
132
- * @see https://svelte.dev/docs#svelte_compile
132
+ * @see https://svelte.dev/docs/svelte/svelte-compiler#CompileOptions
133
133
  */
134
134
  compilerOptions?: Omit<CompileOptions, 'filename' | 'format' | 'generate'>;
135
135
 
package/src/utils/log.js CHANGED
@@ -1,5 +1,10 @@
1
1
  /* eslint-disable no-console */
2
- import { cyan, red, yellow } from 'kleur/colors';
2
+
3
+ import { styleText } from 'node:util';
4
+ const cyan = (/** @type {string} */ txt) => styleText('cyan', txt);
5
+ const yellow = (/** @type {string} */ txt) => styleText('yellow', txt);
6
+ const red = (/** @type {string} */ txt) => styleText('red', txt);
7
+
3
8
  import debug from 'debug';
4
9
 
5
10
  /** @type {import('../types/log.d.ts').LogLevel[]} */
package/types/index.d.ts CHANGED
@@ -121,7 +121,7 @@ declare module '@sveltejs/vite-plugin-svelte' {
121
121
  /**
122
122
  * An array of preprocessors to transform the Svelte source code before compilation
123
123
  *
124
- * @see https://svelte.dev/docs#svelte_preprocess
124
+ * @see https://svelte.dev/docs/svelte/svelte-compiler#PreprocessorGroup
125
125
  */
126
126
  preprocess?: Arrayable<PreprocessorGroup>;
127
127
  /**
@@ -129,7 +129,7 @@ declare module '@sveltejs/vite-plugin-svelte' {
129
129
  * including `dev` and `css`. However, some options are non-configurable, like
130
130
  * `filename`, `format`, `generate`, and `cssHash` (in dev).
131
131
  *
132
- * @see https://svelte.dev/docs#svelte_compile
132
+ * @see https://svelte.dev/docs/svelte/svelte-compiler#CompileOptions
133
133
  */
134
134
  compilerOptions?: Omit<CompileOptions, 'filename' | 'format' | 'generate'>;
135
135