@sveltejs/vite-plugin-svelte 6.2.1 → 6.2.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": "6.2.1",
3
+ "version": "6.2.3",
4
4
  "license": "MIT",
5
5
  "author": "dominikg",
6
6
  "files": [
@@ -35,9 +35,9 @@
35
35
  "homepage": "https://github.com/sveltejs/vite-plugin-svelte#readme",
36
36
  "dependencies": {
37
37
  "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0",
38
- "debug": "^4.4.1",
39
38
  "deepmerge": "^4.3.1",
40
- "magic-string": "^0.30.17",
39
+ "magic-string": "^0.30.21",
40
+ "obug": "^2.1.0",
41
41
  "vitefu": "^1.1.1"
42
42
  },
43
43
  "peerDependencies": {
@@ -46,9 +46,9 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/debug": "^4.1.12",
49
- "sass": "^1.91.0",
50
- "svelte": "^5.38.6",
51
- "vite": "^7.1.4"
49
+ "sass": "^1.94.2",
50
+ "svelte": "^5.45.4",
51
+ "vite": "^7.2.6"
52
52
  },
53
53
  "scripts": {
54
54
  "check:publint": "publint --strict",
@@ -24,7 +24,7 @@ const { version: viteVersion, rolldownVersion } = vite;
24
24
  export function configure(api, inlineOptions) {
25
25
  if (rolldownVersion) {
26
26
  log.warn.once(
27
- `!!! Support for rolldown-vite in vite-plugin-svelte is experimental (rolldown: ${rolldownVersion}, vite: ${viteVersion}) !!!
27
+ `!!! Support for vite 8 beta in vite-plugin-svelte is experimental (rolldown: ${rolldownVersion}, vite: ${viteVersion}) !!!
28
28
  See https://github.com/sveltejs/vite-plugin-svelte/issues/1143 for a list of known issues and to report feedback.`.replace(
29
29
  /\t+/g,
30
30
  '\t'
@@ -43,7 +43,7 @@ export function setupOptimizer(api) {
43
43
  // the added plugins are patched in configResolved below
44
44
  if (rolldownVersion) {
45
45
  //@ts-ignore rolldown types not finished
46
- optimizeDeps.rollupOptions = {
46
+ optimizeDeps.rolldownOptions = {
47
47
  plugins: [
48
48
  placeholderRolldownOptimizerPlugin(optimizeSveltePluginName),
49
49
  placeholderRolldownOptimizerPlugin(optimizeSvelteModulePluginName)
@@ -65,7 +65,7 @@ export function setupOptimizer(api) {
65
65
  if (rolldownVersion) {
66
66
  const plugins =
67
67
  // @ts-expect-error not typed
68
- optimizeDeps.rollupOptions?.plugins?.filter((p) =>
68
+ optimizeDeps.rolldownOptions?.plugins?.filter((p) =>
69
69
  [optimizeSveltePluginName, optimizeSvelteModulePluginName].includes(p.name)
70
70
  ) ?? [];
71
71
  for (const plugin of plugins) {
@@ -21,7 +21,7 @@ export interface Code {
21
21
  map?: any;
22
22
  dependencies?: any[];
23
23
  hasGlobal?: boolean;
24
- moduleType?: string; //rolldown-vite
24
+ moduleType?: string; //vite-8 beta
25
25
  meta?: {
26
26
  vite?: CustomPluginOptionsVite;
27
27
  };
package/src/utils/id.js CHANGED
@@ -184,6 +184,7 @@ export function buildIdFilter(options) {
184
184
  id: {
185
185
  include: [extensionsRE, .../**@type {Array<string|RegExp>}*/ arraify(include)],
186
186
  exclude: /**@type {Array<string|RegExp>}*/ [
187
+ '\0',
187
188
  SVELTE_VIRTUAL_STYLE_ID_REGEX, // exclude from regular pipeline, we load it in a separate plugin
188
189
  ...arraify(exclude)
189
190
  ]
@@ -225,7 +226,7 @@ export function buildModuleIdFilter(options) {
225
226
  return {
226
227
  id: {
227
228
  include: [infixWithExtRE, .../**@type {Array<string|RegExp>}*/ arraify(include)],
228
- exclude: /**@type {Array<string|RegExp>}*/ arraify(exclude)
229
+ exclude: ['\0', .../**@type {Array<string|RegExp>}*/ arraify(exclude)]
229
230
  }
230
231
  };
231
232
  }
package/src/utils/log.js CHANGED
@@ -6,7 +6,7 @@ const cyan = (/** @type {string} */ txt) => styleText('cyan', txt);
6
6
  const yellow = (/** @type {string} */ txt) => styleText('yellow', txt);
7
7
  const red = (/** @type {string} */ txt) => styleText('red', txt);
8
8
 
9
- import debug from 'debug';
9
+ import { createDebug, enabled } from 'obug';
10
10
 
11
11
  /** @type {import('../types/log.d.ts').LogLevel[]} */
12
12
  const levels = ['debug', 'info', 'warn', 'error', 'silent'];
@@ -14,7 +14,7 @@ const prefix = 'vite-plugin-svelte';
14
14
  /** @type {Record<import('../types/log.d.ts').LogLevel, any>} */
15
15
  const loggers = {
16
16
  debug: {
17
- log: debug(`${prefix}`),
17
+ log: createDebug(`${prefix}`),
18
18
  enabled: false,
19
19
  isDebug: true
20
20
  },
@@ -252,5 +252,5 @@ export function buildExtendedLogMessage(w) {
252
252
  * @returns {boolean}
253
253
  */
254
254
  export function isDebugNamespaceEnabled(namespace) {
255
- return debug.enabled(`${prefix}:${namespace}`);
255
+ return enabled(`${prefix}:${namespace}`);
256
256
  }
@@ -423,9 +423,9 @@ function validateViteConfig(extraViteConfig, config, options) {
423
423
  if (rolldownVersion && isBuild) {
424
424
  // read user config inlineConst value
425
425
  const inlineConst =
426
- //@ts-ignore optimization only exists in rolldown-vite
426
+ //@ts-ignore optimization only exists in vite-8 beta
427
427
  config.build?.rolldownOptions?.optimization?.inlineConst ??
428
- //@ts-ignore optimization only exists in rolldown-vite
428
+ //@ts-ignore optimization only exists in vite-8 beta
429
429
  config.build?.rollupOptions?.optimization?.inlineConst;
430
430
 
431
431
  if (inlineConst === false) {