From d32301f4303c7185c1790f5e5ad9e0abb1101304 Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 8 Nov 2024 15:32:24 +0800 Subject: [PATCH 01/14] chore: vite 6 ecosystem-ci support --- .../e2e-tests/kit-node/__tests__/kit.spec.ts | 19 ++++++++++++++----- .../e2e-tests/vite-ssr-esm/vite.config.js | 5 +++++ packages/vite-plugin-svelte/src/index.js | 15 +++++++++++++++ .../vite-plugin-svelte/src/utils/constants.js | 5 +++++ .../vite-plugin-svelte/src/utils/options.js | 5 ++++- .../src/utils/vite-version.js | 6 ++++++ 6 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 packages/vite-plugin-svelte/src/utils/vite-version.js diff --git a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts index 3ae3c8b2d..7173bfec3 100644 --- a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts +++ b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts @@ -14,6 +14,7 @@ import { readFileContent } from '~utils'; +import { version as viteVersion } from 'vite'; import glob from 'tiny-glob'; import path from 'node:path'; import { describe, expect, it } from 'vitest'; @@ -347,11 +348,19 @@ describe('kit-node', () => { ['svelte', 'browser', 'module', 'jsnext:main', 'jsnext'], `resolve.mainFields in ${filename}` ); - expectArrayEqual( - config.resolve.conditions, - ['svelte'], - `resolve.conditions in ${filename}` - ); + if (viteVersion.startsWith('6.')) { + expectArrayEqual( + config.resolve.conditions, + ['browser', 'development|production', 'module', 'svelte'], + `resolve.conditions in ${filename}` + ); + } else { + expectArrayEqual( + config.resolve.conditions, + ['svelte'], + `resolve.conditions in ${filename}` + ); + } } }); }); diff --git a/packages/e2e-tests/vite-ssr-esm/vite.config.js b/packages/e2e-tests/vite-ssr-esm/vite.config.js index 63c8aadaa..f7e25eb6d 100644 --- a/packages/e2e-tests/vite-ssr-esm/vite.config.js +++ b/packages/e2e-tests/vite-ssr-esm/vite.config.js @@ -14,6 +14,11 @@ export default defineConfig(({ command, mode }) => { } } }, + // TODO: investigate the condition issue. it's the same thing dominik and ben found. + // idk why it's only happening after https://github.com/vitejs/vite/pull/18395 + ssr: { + noExternal: ['esm-env'] + }, server: { watch: { // During tests we edit the files too fast and sometimes chokidar diff --git a/packages/vite-plugin-svelte/src/index.js b/packages/vite-plugin-svelte/src/index.js index 622a315d2..c8844a38e 100644 --- a/packages/vite-plugin-svelte/src/index.js +++ b/packages/vite-plugin-svelte/src/index.js @@ -18,6 +18,10 @@ import { saveSvelteMetadata } from './utils/optimizer.js'; import { VitePluginSvelteCache } from './utils/vite-plugin-svelte-cache.js'; import { loadRaw } from './utils/load-raw.js'; import * as svelteCompiler from 'svelte/compiler'; +import { + VITE_CLIENT_RESOLVE_CONDITIONS, + VITE_SERVER_RESOLVE_CONDITIONS +} from './utils/constants.js'; /** * @param {Partial} [inlineOptions] @@ -63,6 +67,17 @@ export function svelte(inlineOptions) { log.debug('additional vite config', extraViteConfig, 'config'); return extraViteConfig; }, + configEnvironment(name, config) { + config.resolve ??= {}; + if (config.resolve.conditions == null) { + if (name === 'client') { + config.resolve.conditions = [...VITE_CLIENT_RESOLVE_CONDITIONS]; + } else { + config.resolve.conditions = [...VITE_SERVER_RESOLVE_CONDITIONS]; + } + } + config.resolve.conditions.push('svelte'); + }, async configResolved(config) { options = resolveOptions(options, config, cache); diff --git a/packages/vite-plugin-svelte/src/utils/constants.js b/packages/vite-plugin-svelte/src/utils/constants.js index 9e251ea88..632d9938e 100644 --- a/packages/vite-plugin-svelte/src/utils/constants.js +++ b/packages/vite-plugin-svelte/src/utils/constants.js @@ -2,6 +2,11 @@ import { createRequire } from 'node:module'; export const VITE_RESOLVE_MAIN_FIELDS = ['browser', 'module', 'jsnext:main', 'jsnext']; +// These two are required for Vite 6 only, as specifying conditions will remove the default ones, +// like the `mainFields` option. Vite 6 is working on exposing these which we can use later. +export const VITE_CLIENT_RESOLVE_CONDITIONS = ['module', 'browser', 'development|production']; +export const VITE_SERVER_RESOLVE_CONDITIONS = ['module', 'node', 'development|production']; + export const SVELTE_RESOLVE_MAIN_FIELDS = ['svelte']; export const SVELTE_IMPORTS = Object.entries( diff --git a/packages/vite-plugin-svelte/src/utils/options.js b/packages/vite-plugin-svelte/src/utils/options.js index dff6eb4fa..d895c566f 100644 --- a/packages/vite-plugin-svelte/src/utils/options.js +++ b/packages/vite-plugin-svelte/src/utils/options.js @@ -30,6 +30,7 @@ import { import { isCommonDepWithoutSvelteField } from './dependencies.js'; import { VitePluginSvelteStats } from './vite-plugin-svelte-stats.js'; +import { isVite6 } from './vite-version.js'; const allowedPluginOptions = new Set([ 'include', @@ -347,7 +348,9 @@ export async function buildExtraViteConfig(options, config) { const extraViteConfig = { resolve: { dedupe: [...SVELTE_IMPORTS], - conditions: [...SVELTE_EXPORT_CONDITIONS] + // In Vite 6, we need to provide the default conditions too as it now replaces the default, + // instead of extending it. We set undefined here and extend it in the `configEnvironment` hook instead. + conditions: isVite6 ? undefined : [...SVELTE_EXPORT_CONDITIONS] } // this option is still awaiting a PR in vite to be supported // see https://github.com/sveltejs/vite-plugin-svelte/issues/60 diff --git a/packages/vite-plugin-svelte/src/utils/vite-version.js b/packages/vite-plugin-svelte/src/utils/vite-version.js new file mode 100644 index 000000000..2449a6737 --- /dev/null +++ b/packages/vite-plugin-svelte/src/utils/vite-version.js @@ -0,0 +1,6 @@ +import { version } from 'vite'; + +/** + * @type {boolean} + */ +export const isVite6 = version.startsWith('6.'); From b39e22222e5abcfeebcb6f82691b2b3530fcf0a1 Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 8 Nov 2024 15:37:16 +0800 Subject: [PATCH 02/14] chore: fix types --- packages/vite-plugin-svelte/src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vite-plugin-svelte/src/index.js b/packages/vite-plugin-svelte/src/index.js index c8844a38e..6a542000c 100644 --- a/packages/vite-plugin-svelte/src/index.js +++ b/packages/vite-plugin-svelte/src/index.js @@ -67,6 +67,7 @@ export function svelte(inlineOptions) { log.debug('additional vite config', extraViteConfig, 'config'); return extraViteConfig; }, + // @ts-ignore Allow exist in vite 6 configEnvironment(name, config) { config.resolve ??= {}; if (config.resolve.conditions == null) { From dcec9afa2a9b1bfd5fe8f0767cc871a2b144a9d6 Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 8 Nov 2024 15:46:12 +0800 Subject: [PATCH 03/14] chore: update types :( --- packages/vite-plugin-svelte/types/index.d.ts.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite-plugin-svelte/types/index.d.ts.map b/packages/vite-plugin-svelte/types/index.d.ts.map index f45ed2c62..86316b60a 100644 --- a/packages/vite-plugin-svelte/types/index.d.ts.map +++ b/packages/vite-plugin-svelte/types/index.d.ts.map @@ -22,5 +22,5 @@ null, null ], - "mappings": ";;;;aAIYA,OAAOA;;;;;;;;;;;;;kBAaFC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGbC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFZC,qBAAqBA;;;;;;;;;;;;;iBC1KtBC,MAAMA;iBCTNC,cAAcA;iBCgBRC,gBAAgBA" + "mappings": ";;;;aAIYA,OAAOA;;;;;;;;;;;;;kBAaFC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGbC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFZC,qBAAqBA;;;;;;;;;;;;;iBCtKtBC,MAAMA;iBCbNC,cAAcA;iBCgBRC,gBAAgBA" } \ No newline at end of file From e54a2a1bee9cb4220d73888fadf7c7e25fd527a4 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 14 Nov 2024 22:21:43 +0800 Subject: [PATCH 04/14] chore: update --- packages/vite-plugin-svelte/src/index.js | 31 +++++++++++++------ .../vite-plugin-svelte/src/utils/constants.js | 5 --- .../vite-plugin-svelte/src/utils/options.js | 22 +++++++------ 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/packages/vite-plugin-svelte/src/index.js b/packages/vite-plugin-svelte/src/index.js index 6a542000c..3b6db137d 100644 --- a/packages/vite-plugin-svelte/src/index.js +++ b/packages/vite-plugin-svelte/src/index.js @@ -18,10 +18,6 @@ import { saveSvelteMetadata } from './utils/optimizer.js'; import { VitePluginSvelteCache } from './utils/vite-plugin-svelte-cache.js'; import { loadRaw } from './utils/load-raw.js'; import * as svelteCompiler from 'svelte/compiler'; -import { - VITE_CLIENT_RESOLVE_CONDITIONS, - VITE_SERVER_RESOLVE_CONDITIONS -} from './utils/constants.js'; /** * @param {Partial} [inlineOptions] @@ -67,14 +63,31 @@ export function svelte(inlineOptions) { log.debug('additional vite config', extraViteConfig, 'config'); return extraViteConfig; }, - // @ts-ignore Allow exist in vite 6 - configEnvironment(name, config) { + + // @ts-ignore This hook only works in Vite 6 + async configEnvironment(name, config, opts) { config.resolve ??= {}; + + // Emulate Vite default fallback for `resolve.mainFields` if not set + if (config.resolve.mainFields == null) { + // These exports only exist in Vite 6 + const { defaultClientMainFields, defaultServerMainFields } = await import('vite'); + if (name === 'client' || opts.isSsrTargetWebworker) { + config.resolve.mainFields = [...defaultClientMainFields]; + } else { + config.resolve.mainFields = [...defaultServerMainFields]; + } + } + config.resolve.mainFields.unshift('svelte'); + + // Emulate Vite default fallback for `resolve.conditions` if not set if (config.resolve.conditions == null) { - if (name === 'client') { - config.resolve.conditions = [...VITE_CLIENT_RESOLVE_CONDITIONS]; + // These exports only exist in Vite 6 + const { defaultClientConditions, defaultServerConditions } = await import('vite'); + if (name === 'client' || opts.isSsrTargetWebworker) { + config.resolve.conditions = [...defaultClientConditions]; } else { - config.resolve.conditions = [...VITE_SERVER_RESOLVE_CONDITIONS]; + config.resolve.conditions = [...defaultServerConditions]; } } config.resolve.conditions.push('svelte'); diff --git a/packages/vite-plugin-svelte/src/utils/constants.js b/packages/vite-plugin-svelte/src/utils/constants.js index 632d9938e..9e251ea88 100644 --- a/packages/vite-plugin-svelte/src/utils/constants.js +++ b/packages/vite-plugin-svelte/src/utils/constants.js @@ -2,11 +2,6 @@ import { createRequire } from 'node:module'; export const VITE_RESOLVE_MAIN_FIELDS = ['browser', 'module', 'jsnext:main', 'jsnext']; -// These two are required for Vite 6 only, as specifying conditions will remove the default ones, -// like the `mainFields` option. Vite 6 is working on exposing these which we can use later. -export const VITE_CLIENT_RESOLVE_CONDITIONS = ['module', 'browser', 'development|production']; -export const VITE_SERVER_RESOLVE_CONDITIONS = ['module', 'node', 'development|production']; - export const SVELTE_RESOLVE_MAIN_FIELDS = ['svelte']; export const SVELTE_IMPORTS = Object.entries( diff --git a/packages/vite-plugin-svelte/src/utils/options.js b/packages/vite-plugin-svelte/src/utils/options.js index d895c566f..9022439d6 100644 --- a/packages/vite-plugin-svelte/src/utils/options.js +++ b/packages/vite-plugin-svelte/src/utils/options.js @@ -334,22 +334,24 @@ function resolveViteRoot(viteConfig) { * @returns {Promise>} */ export async function buildExtraViteConfig(options, config) { - // make sure we only readd vite default mainFields when no other plugin has changed the config already - // see https://github.com/sveltejs/vite-plugin-svelte/issues/581 - if (!config.resolve) { - config.resolve = {}; + // `resolve.mainFields` override the defaults if set, but we want to extend it, so we directly mutate here. + // We only do so for Vite 5 and below, as in Vite 6, `resolve.mainFields` only apply to the client env, + // so we use the `configEnvironment` hook to set it up instead. + if (!isVite6) { + config.resolve ??= {}; + config.resolve.mainFields = [ + ...SVELTE_RESOLVE_MAIN_FIELDS, + ...(config.resolve.mainFields ?? VITE_RESOLVE_MAIN_FIELDS) + ]; } - config.resolve.mainFields = [ - ...SVELTE_RESOLVE_MAIN_FIELDS, - ...(config.resolve.mainFields ?? VITE_RESOLVE_MAIN_FIELDS) - ]; /** @type {Partial} */ const extraViteConfig = { resolve: { dedupe: [...SVELTE_IMPORTS], - // In Vite 6, we need to provide the default conditions too as it now replaces the default, - // instead of extending it. We set undefined here and extend it in the `configEnvironment` hook instead. + // In Vite 6, conditions now override the defaults instead of extending. `resolve.conditions` + // also only apply to the client env, so we use the `configEnvironment` hook to set it up + // instead, so here we set to `undefined` to skip it. conditions: isVite6 ? undefined : [...SVELTE_EXPORT_CONDITIONS] } // this option is still awaiting a PR in vite to be supported From 4fb1e5aa5c7842daf964360c7b12843d2cf643a1 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 14 Nov 2024 22:28:35 +0800 Subject: [PATCH 05/14] chore: update types again :( --- packages/vite-plugin-svelte/types/index.d.ts.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite-plugin-svelte/types/index.d.ts.map b/packages/vite-plugin-svelte/types/index.d.ts.map index 86316b60a..f45ed2c62 100644 --- a/packages/vite-plugin-svelte/types/index.d.ts.map +++ b/packages/vite-plugin-svelte/types/index.d.ts.map @@ -22,5 +22,5 @@ null, null ], - "mappings": ";;;;aAIYA,OAAOA;;;;;;;;;;;;;kBAaFC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGbC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFZC,qBAAqBA;;;;;;;;;;;;;iBCtKtBC,MAAMA;iBCbNC,cAAcA;iBCgBRC,gBAAgBA" + "mappings": ";;;;aAIYA,OAAOA;;;;;;;;;;;;;kBAaFC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGbC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFZC,qBAAqBA;;;;;;;;;;;;;iBC1KtBC,MAAMA;iBCTNC,cAAcA;iBCgBRC,gBAAgBA" } \ No newline at end of file From 47bccb648d7a7c3bf2c446985cac387d7b52eea9 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 14 Nov 2024 22:36:11 +0800 Subject: [PATCH 06/14] chore: update comment --- packages/e2e-tests/vite-ssr-esm/vite.config.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/e2e-tests/vite-ssr-esm/vite.config.js b/packages/e2e-tests/vite-ssr-esm/vite.config.js index f7e25eb6d..2bb5bef5e 100644 --- a/packages/e2e-tests/vite-ssr-esm/vite.config.js +++ b/packages/e2e-tests/vite-ssr-esm/vite.config.js @@ -14,8 +14,18 @@ export default defineConfig(({ command, mode }) => { } } }, - // TODO: investigate the condition issue. it's the same thing dominik and ben found. - // idk why it's only happening after https://github.com/vitejs/vite/pull/18395 + // Because `esm-env` is used by Svelte to determine running in dev mode, and that package + // uses `development` condition to determine so in dev. And on the other hand, Vite uses + // `process.env.NODE_ENV` to determine dev mode, which v-p-s passes to `compilerOptions.dev`, + // there's a potential mismatch of dev condition that Svelte doesn't expect, causing a runtime + // error at https://github.com/sveltejs/svelte/blob/53af138d588f77bb8f4f10f9ad15fd4f798b50ef/packages/svelte/src/internal/server/dev.js#L70 + // TODO: Figure out if either: + // 1. Svelte should work resiliently with mismatch dev/prod modes. + // 2. We hardcode `ssr.noExternal: ['esm-env']` in v-p-s directly, however we're not resolving the root cause. + // 3. We crawl recursively for `esm-env` to resolve no2, but still kinda hacky. + // 4. Encourage users to set `NODE_OPTIONS="--conditions development"` when running vite dev. + // 5. Vite should revert it's external resolve logic, however we're also not resolving the root cause. + // ... or something else ssr: { noExternal: ['esm-env'] }, From 4f20ed2c9077176447f0080cd084eb735fd24369 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 14 Nov 2024 22:46:54 +0800 Subject: [PATCH 07/14] chore: fix --- packages/vite-plugin-svelte/src/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vite-plugin-svelte/src/index.js b/packages/vite-plugin-svelte/src/index.js index 3b6db137d..35f43e048 100644 --- a/packages/vite-plugin-svelte/src/index.js +++ b/packages/vite-plugin-svelte/src/index.js @@ -65,14 +65,14 @@ export function svelte(inlineOptions) { }, // @ts-ignore This hook only works in Vite 6 - async configEnvironment(name, config, opts) { + async configEnvironment(_, config, opts) { config.resolve ??= {}; // Emulate Vite default fallback for `resolve.mainFields` if not set if (config.resolve.mainFields == null) { - // These exports only exist in Vite 6 + // @ts-ignore These exports only exist in Vite 6 const { defaultClientMainFields, defaultServerMainFields } = await import('vite'); - if (name === 'client' || opts.isSsrTargetWebworker) { + if (config.consumer === 'client' || opts.isSsrTargetWebworker) { config.resolve.mainFields = [...defaultClientMainFields]; } else { config.resolve.mainFields = [...defaultServerMainFields]; @@ -82,9 +82,9 @@ export function svelte(inlineOptions) { // Emulate Vite default fallback for `resolve.conditions` if not set if (config.resolve.conditions == null) { - // These exports only exist in Vite 6 + // @ts-ignore These exports only exist in Vite 6 const { defaultClientConditions, defaultServerConditions } = await import('vite'); - if (name === 'client' || opts.isSsrTargetWebworker) { + if (config.consumer === 'client' || opts.isSsrTargetWebworker) { config.resolve.conditions = [...defaultClientConditions]; } else { config.resolve.conditions = [...defaultServerConditions]; From 04b1142a0212e10194f18e8f2d9593e05aa47074 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 14 Nov 2024 23:16:49 +0800 Subject: [PATCH 08/14] chore: remove --- packages/e2e-tests/vite-ssr-esm/vite.config.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/e2e-tests/vite-ssr-esm/vite.config.js b/packages/e2e-tests/vite-ssr-esm/vite.config.js index 2bb5bef5e..63c8aadaa 100644 --- a/packages/e2e-tests/vite-ssr-esm/vite.config.js +++ b/packages/e2e-tests/vite-ssr-esm/vite.config.js @@ -14,21 +14,6 @@ export default defineConfig(({ command, mode }) => { } } }, - // Because `esm-env` is used by Svelte to determine running in dev mode, and that package - // uses `development` condition to determine so in dev. And on the other hand, Vite uses - // `process.env.NODE_ENV` to determine dev mode, which v-p-s passes to `compilerOptions.dev`, - // there's a potential mismatch of dev condition that Svelte doesn't expect, causing a runtime - // error at https://github.com/sveltejs/svelte/blob/53af138d588f77bb8f4f10f9ad15fd4f798b50ef/packages/svelte/src/internal/server/dev.js#L70 - // TODO: Figure out if either: - // 1. Svelte should work resiliently with mismatch dev/prod modes. - // 2. We hardcode `ssr.noExternal: ['esm-env']` in v-p-s directly, however we're not resolving the root cause. - // 3. We crawl recursively for `esm-env` to resolve no2, but still kinda hacky. - // 4. Encourage users to set `NODE_OPTIONS="--conditions development"` when running vite dev. - // 5. Vite should revert it's external resolve logic, however we're also not resolving the root cause. - // ... or something else - ssr: { - noExternal: ['esm-env'] - }, server: { watch: { // During tests we edit the files too fast and sometimes chokidar From e3a04c504262e2141360b2b055f850d3371f613f Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 21 Nov 2024 00:13:50 +0800 Subject: [PATCH 09/14] chore: update vite --- package.json | 2 +- .../autoprefixer-browerslist/package.json | 2 +- .../e2e-tests/configfile-custom/package.json | 2 +- .../e2e-tests/configfile-esm/package.json | 2 +- .../e2e-tests/css-dev-sourcemap/package.json | 2 +- .../e2e-tests/custom-extensions/package.json | 2 +- .../dynamic-compile-options/package.json | 2 +- packages/e2e-tests/env/package.json | 2 +- packages/e2e-tests/hmr/package.json | 2 +- .../e2e-tests/import-queries/package.json | 2 +- packages/e2e-tests/inspector-kit/package.json | 2 +- .../e2e-tests/inspector-vite/package.json | 2 +- .../e2e-tests/kit-node/__tests__/kit.spec.ts | 19 +- packages/e2e-tests/kit-node/package.json | 2 +- .../package-json-svelte-field/package.json | 2 +- .../prebundle-svelte-deps/package.json | 6 +- .../preprocess-with-vite/package.json | 2 +- .../resolve-exports-svelte/package.json | 2 +- packages/e2e-tests/scan-deps/package.json | 2 +- .../e2e-tests/svelte-preprocess/package.json | 2 +- .../e2e-tests/ts-type-import/package.json | 2 +- packages/e2e-tests/vite-ssr-esm/package.json | 2 +- packages/playground/basic/package.json | 2 +- .../big-component-library-kit/package.json | 2 +- .../package.json | 2 +- .../big-component-library/package.json | 2 +- packages/playground/big/package.json | 2 +- packages/playground/kit-demo-app/package.json | 2 +- .../optimizedeps-include/package.json | 2 +- .../vite-plugin-svelte-inspector/package.json | 2 +- packages/vite-plugin-svelte/package.json | 2 +- packages/vite-plugin-svelte/src/index.js | 33 +- .../vite-plugin-svelte/src/utils/constants.js | 4 - .../vite-plugin-svelte/src/utils/options.js | 63 +- .../src/utils/vite-version.js | 6 - pnpm-lock.yaml | 648 ++++++++---------- 36 files changed, 390 insertions(+), 447 deletions(-) delete mode 100644 packages/vite-plugin-svelte/src/utils/vite-version.js diff --git a/package.json b/package.json index 25e27d0e1..d98f0ae1c 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "svelte-eslint-parser": "^0.43.0", "typescript": "^5.6.3", "typescript-eslint": "^8.15.0", - "vite": "^5.4.11", + "vite": "^6.0.0-beta.10", "vitest": "^2.1.5" }, "lint-staged": { diff --git a/packages/e2e-tests/autoprefixer-browerslist/package.json b/packages/e2e-tests/autoprefixer-browerslist/package.json index a5fdc0199..1029453df 100644 --- a/packages/e2e-tests/autoprefixer-browerslist/package.json +++ b/packages/e2e-tests/autoprefixer-browerslist/package.json @@ -17,7 +17,7 @@ "postcss-load-config": "^6.0.1", "svelte": "^5.2.4", "svelte-preprocess": "^6.0.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/configfile-custom/package.json b/packages/e2e-tests/configfile-custom/package.json index d6aabd1fe..950374787 100644 --- a/packages/e2e-tests/configfile-custom/package.json +++ b/packages/e2e-tests/configfile-custom/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/configfile-esm/package.json b/packages/e2e-tests/configfile-esm/package.json index 8c81392f9..b75809b6a 100644 --- a/packages/e2e-tests/configfile-esm/package.json +++ b/packages/e2e-tests/configfile-esm/package.json @@ -14,7 +14,7 @@ "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", "svelte-preprocess": "^6.0.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/css-dev-sourcemap/package.json b/packages/e2e-tests/css-dev-sourcemap/package.json index b405dd65a..e50daac05 100644 --- a/packages/e2e-tests/css-dev-sourcemap/package.json +++ b/packages/e2e-tests/css-dev-sourcemap/package.json @@ -12,6 +12,6 @@ "@sveltejs/vite-plugin-svelte": "workspace:^", "sass": "^1.81.0", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/e2e-tests/custom-extensions/package.json b/packages/e2e-tests/custom-extensions/package.json index 496d92bd9..dc541d9bc 100644 --- a/packages/e2e-tests/custom-extensions/package.json +++ b/packages/e2e-tests/custom-extensions/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/dynamic-compile-options/package.json b/packages/e2e-tests/dynamic-compile-options/package.json index 496d92bd9..dc541d9bc 100644 --- a/packages/e2e-tests/dynamic-compile-options/package.json +++ b/packages/e2e-tests/dynamic-compile-options/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/env/package.json b/packages/e2e-tests/env/package.json index aab456558..56ea8d18c 100644 --- a/packages/e2e-tests/env/package.json +++ b/packages/e2e-tests/env/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/hmr/package.json b/packages/e2e-tests/hmr/package.json index 3bc105b7c..3a882338d 100644 --- a/packages/e2e-tests/hmr/package.json +++ b/packages/e2e-tests/hmr/package.json @@ -15,7 +15,7 @@ "e2e-test-dep-vite-plugins": "file:../_test_dependencies/vite-plugins", "node-fetch": "^3.3.2", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/import-queries/package.json b/packages/e2e-tests/import-queries/package.json index a194e4cc0..941a4c878 100644 --- a/packages/e2e-tests/import-queries/package.json +++ b/packages/e2e-tests/import-queries/package.json @@ -12,6 +12,6 @@ "@sveltejs/vite-plugin-svelte": "workspace:^", "sass": "^1.81.0", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/e2e-tests/inspector-kit/package.json b/packages/e2e-tests/inspector-kit/package.json index a3089b0f7..3e58eb9b8 100644 --- a/packages/e2e-tests/inspector-kit/package.json +++ b/packages/e2e-tests/inspector-kit/package.json @@ -11,7 +11,7 @@ "@sveltejs/kit": "^2.8.1", "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/inspector-vite/package.json b/packages/e2e-tests/inspector-vite/package.json index 56a4dc4f3..9539b2ad9 100644 --- a/packages/e2e-tests/inspector-vite/package.json +++ b/packages/e2e-tests/inspector-vite/package.json @@ -11,6 +11,6 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts index f0b9bf6eb..48bf7c210 100644 --- a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts +++ b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts @@ -14,7 +14,6 @@ import { readFileContent } from '~utils'; -import { version as viteVersion } from 'vite'; import glob from 'tiny-glob'; import path from 'node:path'; import { describe, expect, it } from 'vitest'; @@ -350,19 +349,11 @@ describe('kit-node', () => { ['svelte', 'browser', 'module', 'jsnext:main', 'jsnext'], `resolve.mainFields in ${filename}` ); - if (viteVersion.startsWith('6.')) { - expectArrayEqual( - config.resolve.conditions, - ['browser', 'development|production', 'module', 'svelte'], - `resolve.conditions in ${filename}` - ); - } else { - expectArrayEqual( - config.resolve.conditions, - ['svelte'], - `resolve.conditions in ${filename}` - ); - } + expectArrayEqual( + config.resolve.conditions, + ['browser', 'development|production', 'module', 'svelte'], + `resolve.conditions in ${filename}` + ); } }); }); diff --git a/packages/e2e-tests/kit-node/package.json b/packages/e2e-tests/kit-node/package.json index 21c29dd8d..1c81a2d33 100644 --- a/packages/e2e-tests/kit-node/package.json +++ b/packages/e2e-tests/kit-node/package.json @@ -22,7 +22,7 @@ "svelte-i18n": "^4.0.1", "tiny-glob": "^0.2.9", "typescript": "^5.6.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/package-json-svelte-field/package.json b/packages/e2e-tests/package-json-svelte-field/package.json index 0a68dd5ec..691a34d8c 100644 --- a/packages/e2e-tests/package-json-svelte-field/package.json +++ b/packages/e2e-tests/package-json-svelte-field/package.json @@ -15,7 +15,7 @@ "@sveltejs/vite-plugin-svelte": "workspace:^", "sass": "^1.81.0", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/prebundle-svelte-deps/package.json b/packages/e2e-tests/prebundle-svelte-deps/package.json index 2b3ae5c34..bde23cd53 100644 --- a/packages/e2e-tests/prebundle-svelte-deps/package.json +++ b/packages/e2e-tests/prebundle-svelte-deps/package.json @@ -12,15 +12,15 @@ "e2e-test-dep-svelte-api-only": "file:../_test_dependencies/svelte-api-only", "e2e-test-dep-svelte-exports-simple": "file:../_test_dependencies/svelte-exports-simple", "e2e-test-dep-svelte-hybrid": "file:../_test_dependencies/svelte-hybrid", + "e2e-test-dep-svelte-module": "file:../_test_dependencies/svelte-module", "e2e-test-dep-svelte-nested": "file:../_test_dependencies/svelte-nested", - "e2e-test-dep-svelte-simple": "file:../_test_dependencies/svelte-simple", - "e2e-test-dep-svelte-module": "file:../_test_dependencies/svelte-module" + "e2e-test-dep-svelte-simple": "file:../_test_dependencies/svelte-simple" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "sass": "^1.81.0", "svelte": "^5.2.4", "svelte-preprocess": "^6.0.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/e2e-tests/preprocess-with-vite/package.json b/packages/e2e-tests/preprocess-with-vite/package.json index 90c185810..2494185cb 100644 --- a/packages/e2e-tests/preprocess-with-vite/package.json +++ b/packages/e2e-tests/preprocess-with-vite/package.json @@ -12,7 +12,7 @@ "sass": "^1.81.0", "stylus": "^0.64.0", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/resolve-exports-svelte/package.json b/packages/e2e-tests/resolve-exports-svelte/package.json index d936e43dc..538f7c549 100644 --- a/packages/e2e-tests/resolve-exports-svelte/package.json +++ b/packages/e2e-tests/resolve-exports-svelte/package.json @@ -14,6 +14,6 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/e2e-tests/scan-deps/package.json b/packages/e2e-tests/scan-deps/package.json index 45a97df82..89eb81376 100644 --- a/packages/e2e-tests/scan-deps/package.json +++ b/packages/e2e-tests/scan-deps/package.json @@ -11,6 +11,6 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/e2e-tests/svelte-preprocess/package.json b/packages/e2e-tests/svelte-preprocess/package.json index 44e408fe4..350059892 100644 --- a/packages/e2e-tests/svelte-preprocess/package.json +++ b/packages/e2e-tests/svelte-preprocess/package.json @@ -13,7 +13,7 @@ "svelte": "^5.2.4", "svelte-preprocess": "^6.0.3", "typescript": "^5.6.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/ts-type-import/package.json b/packages/e2e-tests/ts-type-import/package.json index 94d4dcf0e..2f46e6dd3 100644 --- a/packages/e2e-tests/ts-type-import/package.json +++ b/packages/e2e-tests/ts-type-import/package.json @@ -13,7 +13,7 @@ "@types/node": "^22.9.1", "svelte": "^5.2.4", "svelte-preprocess": "^6.0.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/e2e-tests/vite-ssr-esm/package.json b/packages/e2e-tests/vite-ssr-esm/package.json index 676cb6423..1250128d8 100644 --- a/packages/e2e-tests/vite-ssr-esm/package.json +++ b/packages/e2e-tests/vite-ssr-esm/package.json @@ -21,6 +21,6 @@ "npm-run-all2": "^7.0.1", "serve-static": "^1.16.2", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/playground/basic/package.json b/packages/playground/basic/package.json index 7749be1ea..440eb58b5 100644 --- a/packages/playground/basic/package.json +++ b/packages/playground/basic/package.json @@ -12,6 +12,6 @@ "@sveltejs/vite-plugin-svelte": "workspace:^", "e2e-test-dep-svelte-module": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/playground/big-component-library-kit/package.json b/packages/playground/big-component-library-kit/package.json index b5bd7cff1..065ca4fb6 100644 --- a/packages/playground/big-component-library-kit/package.json +++ b/packages/playground/big-component-library-kit/package.json @@ -21,7 +21,7 @@ "svelte-check": "^4.0.9", "svelte-preprocess": "^6.0.3", "typescript": "^5.6.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/playground/big-component-library-vite-ssr/package.json b/packages/playground/big-component-library-vite-ssr/package.json index f5290e290..b92f6a003 100644 --- a/packages/playground/big-component-library-vite-ssr/package.json +++ b/packages/playground/big-component-library-vite-ssr/package.json @@ -24,6 +24,6 @@ "lodash-es": "^4.17.21", "svelte": "^5.2.4", "svelte-preprocess": "^6.0.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/playground/big-component-library/package.json b/packages/playground/big-component-library/package.json index f10b23dd4..22454e096 100644 --- a/packages/playground/big-component-library/package.json +++ b/packages/playground/big-component-library/package.json @@ -15,7 +15,7 @@ "carbon-preprocess-svelte": "^0.11.7", "svelte": "^5.2.4", "svelte-preprocess": "^6.0.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "dependencies": { "lodash-es": "^4.17.21" diff --git a/packages/playground/big/package.json b/packages/playground/big/package.json index 9a868cabe..653500ff6 100644 --- a/packages/playground/big/package.json +++ b/packages/playground/big/package.json @@ -11,6 +11,6 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/playground/kit-demo-app/package.json b/packages/playground/kit-demo-app/package.json index 1faff8c4d..7c3ec97f0 100644 --- a/packages/playground/kit-demo-app/package.json +++ b/packages/playground/kit-demo-app/package.json @@ -18,7 +18,7 @@ "svelte": "^5.2.4", "svelte-check": "^4.0.9", "typescript": "^5.6.3", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" }, "type": "module" } diff --git a/packages/playground/optimizedeps-include/package.json b/packages/playground/optimizedeps-include/package.json index 1b5cbfb91..86613d212 100644 --- a/packages/playground/optimizedeps-include/package.json +++ b/packages/playground/optimizedeps-include/package.json @@ -12,6 +12,6 @@ "@sveltejs/vite-plugin-svelte": "workspace:^", "svelte": "^5.2.4", "tinro": "^0.6.12", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/vite-plugin-svelte-inspector/package.json b/packages/vite-plugin-svelte-inspector/package.json index 82c24758b..bd3037dec 100644 --- a/packages/vite-plugin-svelte-inspector/package.json +++ b/packages/vite-plugin-svelte-inspector/package.json @@ -51,6 +51,6 @@ "devDependencies": { "@types/debug": "^4.1.12", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/vite-plugin-svelte/package.json b/packages/vite-plugin-svelte/package.json index 282696522..d9f4fa5a5 100644 --- a/packages/vite-plugin-svelte/package.json +++ b/packages/vite-plugin-svelte/package.json @@ -57,6 +57,6 @@ "esbuild": "^0.24.0", "sass": "^1.81.0", "svelte": "^5.2.4", - "vite": "^5.4.11" + "vite": "^6.0.0-beta.10" } } diff --git a/packages/vite-plugin-svelte/src/index.js b/packages/vite-plugin-svelte/src/index.js index 35f43e048..8155a633f 100644 --- a/packages/vite-plugin-svelte/src/index.js +++ b/packages/vite-plugin-svelte/src/index.js @@ -10,7 +10,9 @@ import { validateInlineOptions, resolveOptions, patchResolvedViteConfig, - preResolveOptions + preResolveOptions, + ensureConfigEnvironmentMainFields, + ensureConfigEnvironmentConditions } from './utils/options.js'; import { ensureWatchedFile, setupWatchers } from './utils/watch.js'; import { toRollupError } from './utils/error.js'; @@ -64,32 +66,13 @@ export function svelte(inlineOptions) { return extraViteConfig; }, - // @ts-ignore This hook only works in Vite 6 - async configEnvironment(_, config, opts) { - config.resolve ??= {}; - - // Emulate Vite default fallback for `resolve.mainFields` if not set - if (config.resolve.mainFields == null) { - // @ts-ignore These exports only exist in Vite 6 - const { defaultClientMainFields, defaultServerMainFields } = await import('vite'); - if (config.consumer === 'client' || opts.isSsrTargetWebworker) { - config.resolve.mainFields = [...defaultClientMainFields]; - } else { - config.resolve.mainFields = [...defaultServerMainFields]; - } - } + configEnvironment(_, config, opts) { + ensureConfigEnvironmentMainFields(config, opts); + // @ts-expect-error the function above should make `resolve.mainFields` non-nullable config.resolve.mainFields.unshift('svelte'); - // Emulate Vite default fallback for `resolve.conditions` if not set - if (config.resolve.conditions == null) { - // @ts-ignore These exports only exist in Vite 6 - const { defaultClientConditions, defaultServerConditions } = await import('vite'); - if (config.consumer === 'client' || opts.isSsrTargetWebworker) { - config.resolve.conditions = [...defaultClientConditions]; - } else { - config.resolve.conditions = [...defaultServerConditions]; - } - } + ensureConfigEnvironmentConditions(config, opts); + // @ts-expect-error the function above should make `resolve.conditions` non-nullable config.resolve.conditions.push('svelte'); }, diff --git a/packages/vite-plugin-svelte/src/utils/constants.js b/packages/vite-plugin-svelte/src/utils/constants.js index 9e251ea88..3cc59d40f 100644 --- a/packages/vite-plugin-svelte/src/utils/constants.js +++ b/packages/vite-plugin-svelte/src/utils/constants.js @@ -1,9 +1,5 @@ import { createRequire } from 'node:module'; -export const VITE_RESOLVE_MAIN_FIELDS = ['browser', 'module', 'jsnext:main', 'jsnext']; - -export const SVELTE_RESOLVE_MAIN_FIELDS = ['svelte']; - export const SVELTE_IMPORTS = Object.entries( createRequire(import.meta.url)('svelte/package.json').exports ) diff --git a/packages/vite-plugin-svelte/src/utils/options.js b/packages/vite-plugin-svelte/src/utils/options.js index 9022439d6..e308ccdcc 100644 --- a/packages/vite-plugin-svelte/src/utils/options.js +++ b/packages/vite-plugin-svelte/src/utils/options.js @@ -1,14 +1,18 @@ import process from 'node:process'; -import { normalizePath } from 'vite'; +import { + defaultClientMainFields, + defaultServerMainFields, + defaultClientConditions, + defaultServerConditions, + normalizePath +} from 'vite'; import { isDebugNamespaceEnabled, log } from './log.js'; import { loadSvelteConfig } from './load-svelte-config.js'; import { DEFAULT_SVELTE_EXT, FAQ_LINK_MISSING_EXPORTS_CONDITION, SVELTE_EXPORT_CONDITIONS, - SVELTE_IMPORTS, - SVELTE_RESOLVE_MAIN_FIELDS, - VITE_RESOLVE_MAIN_FIELDS + SVELTE_IMPORTS } from './constants.js'; import path from 'node:path'; @@ -30,7 +34,6 @@ import { import { isCommonDepWithoutSvelteField } from './dependencies.js'; import { VitePluginSvelteStats } from './vite-plugin-svelte-stats.js'; -import { isVite6 } from './vite-version.js'; const allowedPluginOptions = new Set([ 'include', @@ -334,25 +337,10 @@ function resolveViteRoot(viteConfig) { * @returns {Promise>} */ export async function buildExtraViteConfig(options, config) { - // `resolve.mainFields` override the defaults if set, but we want to extend it, so we directly mutate here. - // We only do so for Vite 5 and below, as in Vite 6, `resolve.mainFields` only apply to the client env, - // so we use the `configEnvironment` hook to set it up instead. - if (!isVite6) { - config.resolve ??= {}; - config.resolve.mainFields = [ - ...SVELTE_RESOLVE_MAIN_FIELDS, - ...(config.resolve.mainFields ?? VITE_RESOLVE_MAIN_FIELDS) - ]; - } - /** @type {Partial} */ const extraViteConfig = { resolve: { - dedupe: [...SVELTE_IMPORTS], - // In Vite 6, conditions now override the defaults instead of extending. `resolve.conditions` - // also only apply to the client env, so we use the `configEnvironment` hook to set it up - // instead, so here we set to `undefined` to skip it. - conditions: isVite6 ? undefined : [...SVELTE_EXPORT_CONDITIONS] + dedupe: [...SVELTE_IMPORTS] } // this option is still awaiting a PR in vite to be supported // see https://github.com/sveltejs/vite-plugin-svelte/issues/60 @@ -615,6 +603,39 @@ export function patchResolvedViteConfig(viteConfig, options) { } } +/** + * Mutates `config` to ensure `resolve.mainFields` is set. If unset, it emulates Vite's default fallback. + * @param {import('vite').EnvironmentOptions} config + * @param {{ isSsrTargetWebworker?: boolean }} opts + */ +export function ensureConfigEnvironmentMainFields(config, opts) { + config.resolve ??= {}; + if (config.resolve.mainFields == null) { + if (config.consumer === 'client' || opts.isSsrTargetWebworker) { + config.resolve.mainFields = [...defaultClientMainFields]; + } else { + config.resolve.mainFields = [...defaultServerMainFields]; + } + } + return true; +} + +/** + * Mutates `config` to ensure `resolve.conditions` is set. If unset, it emulates Vite's default fallback. + * @param {import('vite').EnvironmentOptions} config + * @param {{ isSsrTargetWebworker?: boolean }} opts + */ +export function ensureConfigEnvironmentConditions(config, opts) { + config.resolve ??= {}; + if (config.resolve.conditions == null) { + if (config.consumer === 'client' || opts.isSsrTargetWebworker) { + config.resolve.conditions = [...defaultClientConditions]; + } else { + config.resolve.conditions = [...defaultServerConditions]; + } + } +} + /** * @template T * @param {T | T[]} value diff --git a/packages/vite-plugin-svelte/src/utils/vite-version.js b/packages/vite-plugin-svelte/src/utils/vite-version.js deleted file mode 100644 index 2449a6737..000000000 --- a/packages/vite-plugin-svelte/src/utils/vite-version.js +++ /dev/null @@ -1,6 +0,0 @@ -import { version } from 'vite'; - -/** - * @type {boolean} - */ -export const isVite6 = version.startsWith('6.'); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1a9dd4eec..41853a2c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ overrides: '@sveltejs/vite-plugin-svelte': workspace:^ '@sveltejs/vite-plugin-svelte-inspector': workspace:^ svelte: ^5.2.4 - vite: ^5.4.11 + vite: ^6.0.0-beta.10 '@types/node@<=20.12.0': 20.11.5 send@<0.19.0: ^0.19.0 @@ -111,11 +111,11 @@ importers: specifier: ^8.15.0 version: 8.15.0(eslint@9.15.0)(typescript@5.6.3) vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) vitest: specifier: ^2.1.5 - version: 2.1.5(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0) + version: 2.1.5(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests: devDependencies: @@ -127,7 +127,7 @@ importers: version: 1.2.2 vitest: specifier: ^2.1.5 - version: 2.1.5(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + version: 2.1.5(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/_test_dependencies/cjs-and-esm: {} @@ -209,8 +209,8 @@ importers: specifier: ^6.0.3 version: 6.0.3(postcss-load-config@6.0.1(postcss@8.4.49)(yaml@2.5.0))(postcss@8.4.49)(sass@1.81.0)(stylus@0.64.0)(svelte@5.2.4)(typescript@5.6.3) vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/configfile-custom: dependencies: @@ -225,8 +225,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/configfile-esm: dependencies: @@ -244,8 +244,8 @@ importers: specifier: ^6.0.3 version: 6.0.3(postcss-load-config@6.0.1(postcss@8.4.49)(yaml@2.5.0))(postcss@8.4.49)(sass@1.81.0)(stylus@0.64.0)(svelte@5.2.4)(typescript@5.6.3) vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/css-dev-sourcemap: devDependencies: @@ -259,8 +259,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/custom-extensions: devDependencies: @@ -271,8 +271,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/dependencies: dependencies: @@ -301,8 +301,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/env: devDependencies: @@ -313,8 +313,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/hmr: dependencies: @@ -335,8 +335,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/import-queries: devDependencies: @@ -350,14 +350,14 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/inspector-kit: devDependencies: '@sveltejs/kit': specifier: ^2.8.1 - version: 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)) + version: 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) '@sveltejs/vite-plugin-svelte': specifier: workspace:^ version: link:../../vite-plugin-svelte @@ -365,8 +365,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/inspector-vite: devDependencies: @@ -377,17 +377,17 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/kit-node: devDependencies: '@sveltejs/adapter-node': specifier: ^5.2.9 - version: 5.2.9(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0))) + version: 5.2.9(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0))) '@sveltejs/kit': specifier: ^2.8.1 - version: 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)) + version: 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) '@sveltejs/package': specifier: ^2.3.7 version: 2.3.7(svelte@5.2.4)(typescript@5.6.3) @@ -416,8 +416,8 @@ importers: specifier: ^5.6.3 version: 5.6.3 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/package-json-svelte-field: dependencies: @@ -438,8 +438,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/prebundle-svelte-deps: dependencies: @@ -475,8 +475,8 @@ importers: specifier: ^6.0.3 version: 6.0.3(postcss-load-config@6.0.1(postcss@8.4.49)(yaml@2.5.0))(postcss@8.4.49)(sass@1.81.0)(stylus@0.64.0)(svelte@5.2.4)(typescript@5.6.3) vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/preprocess-with-vite: devDependencies: @@ -493,8 +493,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/resolve-exports-svelte: dependencies: @@ -509,8 +509,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/scan-deps: devDependencies: @@ -521,8 +521,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/svelte-preprocess: devDependencies: @@ -542,8 +542,8 @@ importers: specifier: ^5.6.3 version: 5.6.3 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/ts-type-import: devDependencies: @@ -563,8 +563,8 @@ importers: specifier: ^6.0.3 version: 6.0.3(postcss-load-config@6.0.1(postcss@8.4.49)(yaml@2.5.0))(postcss@8.4.49)(sass@1.81.0)(stylus@0.64.0)(svelte@5.2.4)(typescript@5.6.3) vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/e2e-tests/vite-ssr-esm: devDependencies: @@ -596,8 +596,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/playground: {} @@ -613,8 +613,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/playground/big: devDependencies: @@ -625,8 +625,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/playground/big-component-library: dependencies: @@ -653,17 +653,17 @@ importers: specifier: ^6.0.3 version: 6.0.3(postcss-load-config@6.0.1(postcss@8.4.49)(yaml@2.5.0))(postcss@8.4.49)(sass@1.81.0)(stylus@0.64.0)(svelte@5.2.4)(typescript@5.6.3) vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/playground/big-component-library-kit: devDependencies: '@sveltejs/adapter-auto': specifier: 3.3.1 - version: 3.3.1(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0))) + version: 3.3.1(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0))) '@sveltejs/kit': specifier: ^2.8.1 - version: 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)) + version: 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) '@sveltejs/vite-plugin-svelte': specifier: workspace:^ version: link:../../vite-plugin-svelte @@ -692,8 +692,8 @@ importers: specifier: ^5.6.3 version: 5.6.3 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/playground/big-component-library-vite-ssr: dependencies: @@ -732,8 +732,8 @@ importers: specifier: ^6.0.3 version: 6.0.3(postcss-load-config@6.0.1(postcss@8.4.49)(yaml@2.5.0))(postcss@8.4.49)(sass@1.81.0)(stylus@0.64.0)(svelte@5.2.4)(typescript@5.6.3) vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/playground/kit-demo-app: devDependencies: @@ -745,10 +745,10 @@ importers: version: 2.2.1 '@sveltejs/adapter-auto': specifier: ^3.3.1 - version: 3.3.1(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0))) + version: 3.3.1(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0))) '@sveltejs/kit': specifier: ^2.8.1 - version: 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)) + version: 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) '@sveltejs/vite-plugin-svelte': specifier: workspace:^ version: link:../../vite-plugin-svelte @@ -762,8 +762,8 @@ importers: specifier: ^5.6.3 version: 5.6.3 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/playground/optimizedeps-include: devDependencies: @@ -777,8 +777,8 @@ importers: specifier: ^0.6.12 version: 0.6.12 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/vite-plugin-svelte: dependencies: @@ -799,7 +799,7 @@ importers: version: 0.30.13 vitefu: specifier: ^1.0.3 - version: 1.0.3(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)) + version: 1.0.3(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) devDependencies: '@types/debug': specifier: ^4.1.12 @@ -814,8 +814,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages/vite-plugin-svelte-inspector: dependencies: @@ -833,8 +833,8 @@ importers: specifier: ^5.2.4 version: 5.2.4 vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + specifier: ^6.0.0-beta.10 + version: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) packages: @@ -917,12 +917,6 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.21.5': - resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - '@esbuild/aix-ppc64@0.24.0': resolution: {integrity: sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==} engines: {node: '>=18'} @@ -935,12 +929,6 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.21.5': - resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - '@esbuild/android-arm64@0.24.0': resolution: {integrity: sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==} engines: {node: '>=18'} @@ -953,12 +941,6 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.21.5': - resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - '@esbuild/android-arm@0.24.0': resolution: {integrity: sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==} engines: {node: '>=18'} @@ -971,12 +953,6 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.21.5': - resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - '@esbuild/android-x64@0.24.0': resolution: {integrity: sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==} engines: {node: '>=18'} @@ -989,12 +965,6 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.21.5': - resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - '@esbuild/darwin-arm64@0.24.0': resolution: {integrity: sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==} engines: {node: '>=18'} @@ -1007,12 +977,6 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.21.5': - resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - '@esbuild/darwin-x64@0.24.0': resolution: {integrity: sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==} engines: {node: '>=18'} @@ -1025,12 +989,6 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.21.5': - resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - '@esbuild/freebsd-arm64@0.24.0': resolution: {integrity: sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==} engines: {node: '>=18'} @@ -1043,12 +1001,6 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.21.5': - resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - '@esbuild/freebsd-x64@0.24.0': resolution: {integrity: sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==} engines: {node: '>=18'} @@ -1061,12 +1013,6 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.21.5': - resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - '@esbuild/linux-arm64@0.24.0': resolution: {integrity: sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==} engines: {node: '>=18'} @@ -1079,12 +1025,6 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.21.5': - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - '@esbuild/linux-arm@0.24.0': resolution: {integrity: sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==} engines: {node: '>=18'} @@ -1097,12 +1037,6 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.21.5': - resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - '@esbuild/linux-ia32@0.24.0': resolution: {integrity: sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==} engines: {node: '>=18'} @@ -1115,12 +1049,6 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.21.5': - resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - '@esbuild/linux-loong64@0.24.0': resolution: {integrity: sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==} engines: {node: '>=18'} @@ -1133,12 +1061,6 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.21.5': - resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - '@esbuild/linux-mips64el@0.24.0': resolution: {integrity: sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==} engines: {node: '>=18'} @@ -1151,12 +1073,6 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.21.5': - resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - '@esbuild/linux-ppc64@0.24.0': resolution: {integrity: sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==} engines: {node: '>=18'} @@ -1169,12 +1085,6 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.21.5': - resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - '@esbuild/linux-riscv64@0.24.0': resolution: {integrity: sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==} engines: {node: '>=18'} @@ -1187,12 +1097,6 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.21.5': - resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - '@esbuild/linux-s390x@0.24.0': resolution: {integrity: sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==} engines: {node: '>=18'} @@ -1205,12 +1109,6 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.21.5': - resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - '@esbuild/linux-x64@0.24.0': resolution: {integrity: sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==} engines: {node: '>=18'} @@ -1223,12 +1121,6 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.21.5': - resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - '@esbuild/netbsd-x64@0.24.0': resolution: {integrity: sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==} engines: {node: '>=18'} @@ -1247,12 +1139,6 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.21.5': - resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - '@esbuild/openbsd-x64@0.24.0': resolution: {integrity: sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==} engines: {node: '>=18'} @@ -1265,12 +1151,6 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.21.5': - resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - '@esbuild/sunos-x64@0.24.0': resolution: {integrity: sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==} engines: {node: '>=18'} @@ -1283,12 +1163,6 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.21.5': - resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - '@esbuild/win32-arm64@0.24.0': resolution: {integrity: sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==} engines: {node: '>=18'} @@ -1301,12 +1175,6 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.21.5': - resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - '@esbuild/win32-ia32@0.24.0': resolution: {integrity: sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==} engines: {node: '>=18'} @@ -1319,12 +1187,6 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.21.5': - resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - '@esbuild/win32-x64@0.24.0': resolution: {integrity: sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==} engines: {node: '>=18'} @@ -1581,81 +1443,171 @@ packages: cpu: [arm] os: [android] + '@rollup/rollup-android-arm-eabi@4.27.3': + resolution: {integrity: sha512-EzxVSkIvCFxUd4Mgm4xR9YXrcp976qVaHnqom/Tgm+vU79k4vV4eYTjmRvGfeoW8m9LVcsAy/lGjcgVegKEhLQ==} + cpu: [arm] + os: [android] + '@rollup/rollup-android-arm64@4.24.0': resolution: {integrity: sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==} cpu: [arm64] os: [android] + '@rollup/rollup-android-arm64@4.27.3': + resolution: {integrity: sha512-LJc5pDf1wjlt9o/Giaw9Ofl+k/vLUaYsE2zeQGH85giX2F+wn/Cg8b3c5CDP3qmVmeO5NzwVUzQQxwZvC2eQKw==} + cpu: [arm64] + os: [android] + '@rollup/rollup-darwin-arm64@4.24.0': resolution: {integrity: sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==} cpu: [arm64] os: [darwin] + '@rollup/rollup-darwin-arm64@4.27.3': + resolution: {integrity: sha512-OuRysZ1Mt7wpWJ+aYKblVbJWtVn3Cy52h8nLuNSzTqSesYw1EuN6wKp5NW/4eSre3mp12gqFRXOKTcN3AI3LqA==} + cpu: [arm64] + os: [darwin] + '@rollup/rollup-darwin-x64@4.24.0': resolution: {integrity: sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==} cpu: [x64] os: [darwin] + '@rollup/rollup-darwin-x64@4.27.3': + resolution: {integrity: sha512-xW//zjJMlJs2sOrCmXdB4d0uiilZsOdlGQIC/jjmMWT47lkLLoB1nsNhPUcnoqyi5YR6I4h+FjBpILxbEy8JRg==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.27.3': + resolution: {integrity: sha512-58E0tIcwZ+12nK1WiLzHOD8I0d0kdrY/+o7yFVPRHuVGY3twBwzwDdTIBGRxLmyjciMYl1B/U515GJy+yn46qw==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.27.3': + resolution: {integrity: sha512-78fohrpcVwTLxg1ZzBMlwEimoAJmY6B+5TsyAZ3Vok7YabRBUvjYTsRXPTjGEvv/mfgVBepbW28OlMEz4w8wGA==} + cpu: [x64] + os: [freebsd] + '@rollup/rollup-linux-arm-gnueabihf@4.24.0': resolution: {integrity: sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm-gnueabihf@4.27.3': + resolution: {integrity: sha512-h2Ay79YFXyQi+QZKo3ISZDyKaVD7uUvukEHTOft7kh00WF9mxAaxZsNs3o/eukbeKuH35jBvQqrT61fzKfAB/Q==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.24.0': resolution: {integrity: sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.27.3': + resolution: {integrity: sha512-Sv2GWmrJfRY57urktVLQ0VKZjNZGogVtASAgosDZ1aUB+ykPxSi3X1nWORL5Jk0sTIIwQiPH7iE3BMi9zGWfkg==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.24.0': resolution: {integrity: sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.27.3': + resolution: {integrity: sha512-FPoJBLsPW2bDNWjSrwNuTPUt30VnfM8GPGRoLCYKZpPx0xiIEdFip3dH6CqgoT0RnoGXptaNziM0WlKgBc+OWQ==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-arm64-musl@4.24.0': resolution: {integrity: sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-arm64-musl@4.27.3': + resolution: {integrity: sha512-TKxiOvBorYq4sUpA0JT+Fkh+l+G9DScnG5Dqx7wiiqVMiRSkzTclP35pE6eQQYjP4Gc8yEkJGea6rz4qyWhp3g==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': resolution: {integrity: sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==} cpu: [ppc64] os: [linux] + '@rollup/rollup-linux-powerpc64le-gnu@4.27.3': + resolution: {integrity: sha512-v2M/mPvVUKVOKITa0oCFksnQQ/TqGrT+yD0184/cWHIu0LoIuYHwox0Pm3ccXEz8cEQDLk6FPKd1CCm+PlsISw==} + cpu: [ppc64] + os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.24.0': resolution: {integrity: sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==} cpu: [riscv64] os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.27.3': + resolution: {integrity: sha512-LdrI4Yocb1a/tFVkzmOE5WyYRgEBOyEhWYJe4gsDWDiwnjYKjNs7PS6SGlTDB7maOHF4kxevsuNBl2iOcj3b4A==} + cpu: [riscv64] + os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.24.0': resolution: {integrity: sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==} cpu: [s390x] os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.27.3': + resolution: {integrity: sha512-d4wVu6SXij/jyiwPvI6C4KxdGzuZOvJ6y9VfrcleHTwo68fl8vZC5ZYHsCVPUi4tndCfMlFniWgwonQ5CUpQcA==} + cpu: [s390x] + os: [linux] + '@rollup/rollup-linux-x64-gnu@4.24.0': resolution: {integrity: sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==} cpu: [x64] os: [linux] + '@rollup/rollup-linux-x64-gnu@4.27.3': + resolution: {integrity: sha512-/6bn6pp1fsCGEY5n3yajmzZQAh+mW4QPItbiWxs69zskBzJuheb3tNynEjL+mKOsUSFK11X4LYF2BwwXnzWleA==} + cpu: [x64] + os: [linux] + '@rollup/rollup-linux-x64-musl@4.24.0': resolution: {integrity: sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==} cpu: [x64] os: [linux] + '@rollup/rollup-linux-x64-musl@4.27.3': + resolution: {integrity: sha512-nBXOfJds8OzUT1qUreT/en3eyOXd2EH5b0wr2bVB5999qHdGKkzGzIyKYaKj02lXk6wpN71ltLIaQpu58YFBoQ==} + cpu: [x64] + os: [linux] + '@rollup/rollup-win32-arm64-msvc@4.24.0': resolution: {integrity: sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==} cpu: [arm64] os: [win32] + '@rollup/rollup-win32-arm64-msvc@4.27.3': + resolution: {integrity: sha512-ogfbEVQgIZOz5WPWXF2HVb6En+kWzScuxJo/WdQTqEgeyGkaa2ui5sQav9Zkr7bnNCLK48uxmmK0TySm22eiuw==} + cpu: [arm64] + os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.24.0': resolution: {integrity: sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==} cpu: [ia32] os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.27.3': + resolution: {integrity: sha512-ecE36ZBMLINqiTtSNQ1vzWc5pXLQHlf/oqGp/bSbi7iedcjcNb6QbCBNG73Euyy2C+l/fn8qKWEwxr+0SSfs3w==} + cpu: [ia32] + os: [win32] + '@rollup/rollup-win32-x64-msvc@4.24.0': resolution: {integrity: sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==} cpu: [x64] os: [win32] + '@rollup/rollup-win32-x64-msvc@4.27.3': + resolution: {integrity: sha512-vliZLrDmYKyaUoMzEbMTg2JkerfBjn03KmAw9CykO0Zzkzoyd7o3iZNam/TpyWNjNT+Cz2iO3P9Smv2wgrR+Eg==} + cpu: [x64] + os: [win32] + '@stylistic/eslint-plugin-js@2.11.0': resolution: {integrity: sha512-btchD0P3iij6cIk5RR5QMdEhtCCV0+L6cNheGhGCd//jaHILZMTi/EOqgEDAf1s4ZoViyExoToM+S2Iwa3U9DA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1690,7 +1642,7 @@ packages: peerDependencies: '@sveltejs/vite-plugin-svelte': workspace:^ svelte: ^5.2.4 - vite: ^5.4.11 + vite: ^6.0.0-beta.10 '@sveltejs/package@2.3.7': resolution: {integrity: sha512-LYgUkde5GUYqOpXbcoCGUpEH4Ctl3Wj4u4CVZBl56dEeLW5fGHE037ZL1qlK0Ky+QD5uUfwONSeGwIOIighFMQ==} @@ -1814,7 +1766,7 @@ packages: resolution: {integrity: sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==} peerDependencies: msw: ^2.4.9 - vite: ^5.4.11 + vite: ^6.0.0-beta.10 peerDependenciesMeta: msw: optional: true @@ -2267,11 +2219,6 @@ packages: engines: {node: '>=12'} hasBin: true - esbuild@0.21.5: - resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} - engines: {node: '>=12'} - hasBin: true - esbuild@0.24.0: resolution: {integrity: sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==} engines: {node: '>=18'} @@ -3307,6 +3254,11 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + rollup@4.27.3: + resolution: {integrity: sha512-SLsCOnlmGt9VoZ9Ek8yBK8tAdmPHeppkw+Xa7yDlCEhDTvwYei03JlWo1fdc7YTfLZ4tD8riJCUyAgTbszk1fQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -3679,22 +3631,27 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite@5.4.11: - resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==} + vite@6.0.0-beta.10: + resolution: {integrity: sha512-I+XjYmS0KAx8kxYTFidFZRkDG1h7bKfharrtjFWkKYZxGaUSKMqZZdsJ9Wsh0myRlzzWdRgty9jGC51bAl8BYA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@types/node': 20.11.5 + jiti: '>=1.21.0' less: '*' lightningcss: ^1.21.0 sass: '*' sass-embedded: '*' stylus: '*' sugarss: '*' - terser: ^5.4.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 peerDependenciesMeta: '@types/node': optional: true + jiti: + optional: true less: optional: true lightningcss: @@ -3709,11 +3666,15 @@ packages: optional: true terser: optional: true + tsx: + optional: true + yaml: + optional: true vitefu@1.0.3: resolution: {integrity: sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==} peerDependencies: - vite: ^5.4.11 + vite: ^6.0.0-beta.10 peerDependenciesMeta: vite: optional: true @@ -3966,162 +3927,108 @@ snapshots: '@esbuild/aix-ppc64@0.19.10': optional: true - '@esbuild/aix-ppc64@0.21.5': - optional: true - '@esbuild/aix-ppc64@0.24.0': optional: true '@esbuild/android-arm64@0.19.10': optional: true - '@esbuild/android-arm64@0.21.5': - optional: true - '@esbuild/android-arm64@0.24.0': optional: true '@esbuild/android-arm@0.19.10': optional: true - '@esbuild/android-arm@0.21.5': - optional: true - '@esbuild/android-arm@0.24.0': optional: true '@esbuild/android-x64@0.19.10': optional: true - '@esbuild/android-x64@0.21.5': - optional: true - '@esbuild/android-x64@0.24.0': optional: true '@esbuild/darwin-arm64@0.19.10': optional: true - '@esbuild/darwin-arm64@0.21.5': - optional: true - '@esbuild/darwin-arm64@0.24.0': optional: true '@esbuild/darwin-x64@0.19.10': optional: true - '@esbuild/darwin-x64@0.21.5': - optional: true - '@esbuild/darwin-x64@0.24.0': optional: true '@esbuild/freebsd-arm64@0.19.10': optional: true - '@esbuild/freebsd-arm64@0.21.5': - optional: true - '@esbuild/freebsd-arm64@0.24.0': optional: true '@esbuild/freebsd-x64@0.19.10': optional: true - '@esbuild/freebsd-x64@0.21.5': - optional: true - '@esbuild/freebsd-x64@0.24.0': optional: true '@esbuild/linux-arm64@0.19.10': optional: true - '@esbuild/linux-arm64@0.21.5': - optional: true - '@esbuild/linux-arm64@0.24.0': optional: true '@esbuild/linux-arm@0.19.10': optional: true - '@esbuild/linux-arm@0.21.5': - optional: true - '@esbuild/linux-arm@0.24.0': optional: true '@esbuild/linux-ia32@0.19.10': optional: true - '@esbuild/linux-ia32@0.21.5': - optional: true - '@esbuild/linux-ia32@0.24.0': optional: true '@esbuild/linux-loong64@0.19.10': optional: true - '@esbuild/linux-loong64@0.21.5': - optional: true - '@esbuild/linux-loong64@0.24.0': optional: true '@esbuild/linux-mips64el@0.19.10': optional: true - '@esbuild/linux-mips64el@0.21.5': - optional: true - '@esbuild/linux-mips64el@0.24.0': optional: true '@esbuild/linux-ppc64@0.19.10': optional: true - '@esbuild/linux-ppc64@0.21.5': - optional: true - '@esbuild/linux-ppc64@0.24.0': optional: true '@esbuild/linux-riscv64@0.19.10': optional: true - '@esbuild/linux-riscv64@0.21.5': - optional: true - '@esbuild/linux-riscv64@0.24.0': optional: true '@esbuild/linux-s390x@0.19.10': optional: true - '@esbuild/linux-s390x@0.21.5': - optional: true - '@esbuild/linux-s390x@0.24.0': optional: true '@esbuild/linux-x64@0.19.10': optional: true - '@esbuild/linux-x64@0.21.5': - optional: true - '@esbuild/linux-x64@0.24.0': optional: true '@esbuild/netbsd-x64@0.19.10': optional: true - '@esbuild/netbsd-x64@0.21.5': - optional: true - '@esbuild/netbsd-x64@0.24.0': optional: true @@ -4131,45 +4038,30 @@ snapshots: '@esbuild/openbsd-x64@0.19.10': optional: true - '@esbuild/openbsd-x64@0.21.5': - optional: true - '@esbuild/openbsd-x64@0.24.0': optional: true '@esbuild/sunos-x64@0.19.10': optional: true - '@esbuild/sunos-x64@0.21.5': - optional: true - '@esbuild/sunos-x64@0.24.0': optional: true '@esbuild/win32-arm64@0.19.10': optional: true - '@esbuild/win32-arm64@0.21.5': - optional: true - '@esbuild/win32-arm64@0.24.0': optional: true '@esbuild/win32-ia32@0.19.10': optional: true - '@esbuild/win32-ia32@0.21.5': - optional: true - '@esbuild/win32-ia32@0.24.0': optional: true '@esbuild/win32-x64@0.19.10': optional: true - '@esbuild/win32-x64@0.21.5': - optional: true - '@esbuild/win32-x64@0.24.0': optional: true @@ -4417,68 +4309,122 @@ snapshots: '@rollup/rollup-android-arm-eabi@4.24.0': optional: true + '@rollup/rollup-android-arm-eabi@4.27.3': + optional: true + '@rollup/rollup-android-arm64@4.24.0': optional: true + '@rollup/rollup-android-arm64@4.27.3': + optional: true + '@rollup/rollup-darwin-arm64@4.24.0': optional: true + '@rollup/rollup-darwin-arm64@4.27.3': + optional: true + '@rollup/rollup-darwin-x64@4.24.0': optional: true + '@rollup/rollup-darwin-x64@4.27.3': + optional: true + + '@rollup/rollup-freebsd-arm64@4.27.3': + optional: true + + '@rollup/rollup-freebsd-x64@4.27.3': + optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.24.0': optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.27.3': + optional: true + '@rollup/rollup-linux-arm-musleabihf@4.24.0': optional: true + '@rollup/rollup-linux-arm-musleabihf@4.27.3': + optional: true + '@rollup/rollup-linux-arm64-gnu@4.24.0': optional: true + '@rollup/rollup-linux-arm64-gnu@4.27.3': + optional: true + '@rollup/rollup-linux-arm64-musl@4.24.0': optional: true + '@rollup/rollup-linux-arm64-musl@4.27.3': + optional: true + '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': optional: true + '@rollup/rollup-linux-powerpc64le-gnu@4.27.3': + optional: true + '@rollup/rollup-linux-riscv64-gnu@4.24.0': optional: true + '@rollup/rollup-linux-riscv64-gnu@4.27.3': + optional: true + '@rollup/rollup-linux-s390x-gnu@4.24.0': optional: true + '@rollup/rollup-linux-s390x-gnu@4.27.3': + optional: true + '@rollup/rollup-linux-x64-gnu@4.24.0': optional: true + '@rollup/rollup-linux-x64-gnu@4.27.3': + optional: true + '@rollup/rollup-linux-x64-musl@4.24.0': optional: true + '@rollup/rollup-linux-x64-musl@4.27.3': + optional: true + '@rollup/rollup-win32-arm64-msvc@4.24.0': optional: true + '@rollup/rollup-win32-arm64-msvc@4.27.3': + optional: true + '@rollup/rollup-win32-ia32-msvc@4.24.0': optional: true + '@rollup/rollup-win32-ia32-msvc@4.27.3': + optional: true + '@rollup/rollup-win32-x64-msvc@4.24.0': optional: true + '@rollup/rollup-win32-x64-msvc@4.27.3': + optional: true + '@stylistic/eslint-plugin-js@2.11.0(eslint@9.15.0)': dependencies: eslint: 9.15.0 eslint-visitor-keys: 4.2.0 espree: 10.3.0 - '@sveltejs/adapter-auto@3.3.1(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)))': + '@sveltejs/adapter-auto@3.3.1(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)))': dependencies: - '@sveltejs/kit': 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)) + '@sveltejs/kit': 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) import-meta-resolve: 4.1.0 - '@sveltejs/adapter-node@5.2.9(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)))': + '@sveltejs/adapter-node@5.2.9(@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)))': dependencies: '@rollup/plugin-commonjs': 28.0.1(rollup@4.24.0) '@rollup/plugin-json': 6.1.0(rollup@4.24.0) '@rollup/plugin-node-resolve': 15.3.0(rollup@4.24.0) - '@sveltejs/kit': 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)) + '@sveltejs/kit': 2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) rollup: 4.24.0 '@sveltejs/eslint-config@8.1.0(@stylistic/eslint-plugin-js@2.11.0(eslint@9.15.0))(eslint-config-prettier@9.1.0(eslint@9.15.0))(eslint-plugin-n@17.13.2(eslint@9.15.0))(eslint-plugin-svelte@2.46.0(eslint@9.15.0)(svelte@5.2.4))(eslint@9.15.0)(typescript-eslint@8.15.0(eslint@9.15.0)(typescript@5.6.3))(typescript@5.6.3)': @@ -4492,7 +4438,7 @@ snapshots: typescript: 5.6.3 typescript-eslint: 8.15.0(eslint@9.15.0)(typescript@5.6.3) - '@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0))': + '@sveltejs/kit@2.8.1(@sveltejs/vite-plugin-svelte@packages+vite-plugin-svelte)(svelte@5.2.4)(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0))': dependencies: '@sveltejs/vite-plugin-svelte': link:packages/vite-plugin-svelte '@types/cookie': 0.6.0 @@ -4508,7 +4454,7 @@ snapshots: sirv: 3.0.0 svelte: 5.2.4 tiny-glob: 0.2.9 - vite: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + vite: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) '@sveltejs/package@2.3.7(svelte@5.2.4)(typescript@5.6.3)': dependencies: @@ -4662,21 +4608,21 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.5(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0))': + '@vitest/mocker@2.1.5(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0))': dependencies: '@vitest/spy': 2.1.5 estree-walker: 3.0.3 magic-string: 0.30.13 optionalDependencies: - vite: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + vite: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) - '@vitest/mocker@2.1.5(vite@5.4.11(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0))': + '@vitest/mocker@2.1.5(vite@6.0.0-beta.10(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0))': dependencies: '@vitest/spy': 2.1.5 estree-walker: 3.0.3 magic-string: 0.30.13 optionalDependencies: - vite: 5.4.11(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0) + vite: 6.0.0-beta.10(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) '@vitest/pretty-format@2.1.5': dependencies: @@ -5130,32 +5076,6 @@ snapshots: '@esbuild/win32-ia32': 0.19.10 '@esbuild/win32-x64': 0.19.10 - esbuild@0.21.5: - optionalDependencies: - '@esbuild/aix-ppc64': 0.21.5 - '@esbuild/android-arm': 0.21.5 - '@esbuild/android-arm64': 0.21.5 - '@esbuild/android-x64': 0.21.5 - '@esbuild/darwin-arm64': 0.21.5 - '@esbuild/darwin-x64': 0.21.5 - '@esbuild/freebsd-arm64': 0.21.5 - '@esbuild/freebsd-x64': 0.21.5 - '@esbuild/linux-arm': 0.21.5 - '@esbuild/linux-arm64': 0.21.5 - '@esbuild/linux-ia32': 0.21.5 - '@esbuild/linux-loong64': 0.21.5 - '@esbuild/linux-mips64el': 0.21.5 - '@esbuild/linux-ppc64': 0.21.5 - '@esbuild/linux-riscv64': 0.21.5 - '@esbuild/linux-s390x': 0.21.5 - '@esbuild/linux-x64': 0.21.5 - '@esbuild/netbsd-x64': 0.21.5 - '@esbuild/openbsd-x64': 0.21.5 - '@esbuild/sunos-x64': 0.21.5 - '@esbuild/win32-arm64': 0.21.5 - '@esbuild/win32-ia32': 0.21.5 - '@esbuild/win32-x64': 0.21.5 - esbuild@0.24.0: optionalDependencies: '@esbuild/aix-ppc64': 0.24.0 @@ -6224,6 +6144,30 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.24.0 fsevents: 2.3.3 + rollup@4.27.3: + dependencies: + '@types/estree': 1.0.6 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.27.3 + '@rollup/rollup-android-arm64': 4.27.3 + '@rollup/rollup-darwin-arm64': 4.27.3 + '@rollup/rollup-darwin-x64': 4.27.3 + '@rollup/rollup-freebsd-arm64': 4.27.3 + '@rollup/rollup-freebsd-x64': 4.27.3 + '@rollup/rollup-linux-arm-gnueabihf': 4.27.3 + '@rollup/rollup-linux-arm-musleabihf': 4.27.3 + '@rollup/rollup-linux-arm64-gnu': 4.27.3 + '@rollup/rollup-linux-arm64-musl': 4.27.3 + '@rollup/rollup-linux-powerpc64le-gnu': 4.27.3 + '@rollup/rollup-linux-riscv64-gnu': 4.27.3 + '@rollup/rollup-linux-s390x-gnu': 4.27.3 + '@rollup/rollup-linux-x64-gnu': 4.27.3 + '@rollup/rollup-linux-x64-musl': 4.27.3 + '@rollup/rollup-win32-arm64-msvc': 4.27.3 + '@rollup/rollup-win32-ia32-msvc': 4.27.3 + '@rollup/rollup-win32-x64-msvc': 4.27.3 + fsevents: 2.3.3 + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 @@ -6567,15 +6511,16 @@ snapshots: vary@1.1.2: {} - vite-node@2.1.5(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0): + vite-node@2.1.5(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0): dependencies: cac: 6.7.14 debug: 4.3.7 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + vite: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) transitivePeerDependencies: - '@types/node' + - jiti - less - lightningcss - sass @@ -6584,16 +6529,19 @@ snapshots: - sugarss - supports-color - terser + - tsx + - yaml - vite-node@2.1.5(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0): + vite-node@2.1.5(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0): dependencies: cac: 6.7.14 debug: 4.3.7 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.4.11(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0) + vite: 6.0.0-beta.10(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) transitivePeerDependencies: - '@types/node' + - jiti - less - lightningcss - sass @@ -6602,37 +6550,41 @@ snapshots: - sugarss - supports-color - terser + - tsx + - yaml - vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0): + vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0): dependencies: - esbuild: 0.21.5 + esbuild: 0.24.0 postcss: 8.4.49 - rollup: 4.24.0 + rollup: 4.27.3 optionalDependencies: '@types/node': 20.11.5 fsevents: 2.3.3 sass: 1.81.0 stylus: 0.64.0 + yaml: 2.5.0 - vite@5.4.11(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0): + vite@6.0.0-beta.10(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0): dependencies: - esbuild: 0.21.5 + esbuild: 0.24.0 postcss: 8.4.49 - rollup: 4.24.0 + rollup: 4.27.3 optionalDependencies: '@types/node': 22.9.1 fsevents: 2.3.3 sass: 1.81.0 stylus: 0.64.0 + yaml: 2.5.0 - vitefu@1.0.3(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)): + vitefu@1.0.3(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)): optionalDependencies: - vite: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + vite: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) - vitest@2.1.5(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0): + vitest@2.1.5(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0): dependencies: '@vitest/expect': 2.1.5 - '@vitest/mocker': 2.1.5(vite@5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)) + '@vitest/mocker': 2.1.5(vite@6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) '@vitest/pretty-format': 2.1.5 '@vitest/runner': 2.1.5 '@vitest/snapshot': 2.1.5 @@ -6648,12 +6600,13 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.2 tinyrainbow: 1.2.0 - vite: 5.4.11(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) - vite-node: 2.1.5(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0) + vite: 6.0.0-beta.10(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) + vite-node: 2.1.5(@types/node@20.11.5)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.11.5 transitivePeerDependencies: + - jiti - less - lightningcss - msw @@ -6663,11 +6616,13 @@ snapshots: - sugarss - supports-color - terser + - tsx + - yaml - vitest@2.1.5(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0): + vitest@2.1.5(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0): dependencies: '@vitest/expect': 2.1.5 - '@vitest/mocker': 2.1.5(vite@5.4.11(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)) + '@vitest/mocker': 2.1.5(vite@6.0.0-beta.10(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0)) '@vitest/pretty-format': 2.1.5 '@vitest/runner': 2.1.5 '@vitest/snapshot': 2.1.5 @@ -6683,12 +6638,13 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.2 tinyrainbow: 1.2.0 - vite: 5.4.11(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0) - vite-node: 2.1.5(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0) + vite: 6.0.0-beta.10(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) + vite-node: 2.1.5(@types/node@22.9.1)(sass@1.81.0)(stylus@0.64.0)(yaml@2.5.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.9.1 transitivePeerDependencies: + - jiti - less - lightningcss - msw @@ -6698,6 +6654,8 @@ snapshots: - sugarss - supports-color - terser + - tsx + - yaml web-streams-polyfill@3.2.1: {} From e1aa2a1232d5f5440b3488e30b46802b54928815 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 21 Nov 2024 12:22:36 +0800 Subject: [PATCH 10/14] chore: fix logic --- packages/vite-plugin-svelte/src/index.js | 6 +++--- packages/vite-plugin-svelte/src/utils/options.js | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/vite-plugin-svelte/src/index.js b/packages/vite-plugin-svelte/src/index.js index 8155a633f..4b27ffec6 100644 --- a/packages/vite-plugin-svelte/src/index.js +++ b/packages/vite-plugin-svelte/src/index.js @@ -66,12 +66,12 @@ export function svelte(inlineOptions) { return extraViteConfig; }, - configEnvironment(_, config, opts) { - ensureConfigEnvironmentMainFields(config, opts); + configEnvironment(name, config, opts) { + ensureConfigEnvironmentMainFields(name, config, opts); // @ts-expect-error the function above should make `resolve.mainFields` non-nullable config.resolve.mainFields.unshift('svelte'); - ensureConfigEnvironmentConditions(config, opts); + ensureConfigEnvironmentConditions(name, config, opts); // @ts-expect-error the function above should make `resolve.conditions` non-nullable config.resolve.conditions.push('svelte'); }, diff --git a/packages/vite-plugin-svelte/src/utils/options.js b/packages/vite-plugin-svelte/src/utils/options.js index e308ccdcc..ce9892c51 100644 --- a/packages/vite-plugin-svelte/src/utils/options.js +++ b/packages/vite-plugin-svelte/src/utils/options.js @@ -605,13 +605,14 @@ export function patchResolvedViteConfig(viteConfig, options) { /** * Mutates `config` to ensure `resolve.mainFields` is set. If unset, it emulates Vite's default fallback. + * @param {string} name * @param {import('vite').EnvironmentOptions} config * @param {{ isSsrTargetWebworker?: boolean }} opts */ -export function ensureConfigEnvironmentMainFields(config, opts) { +export function ensureConfigEnvironmentMainFields(name, config, opts) { config.resolve ??= {}; if (config.resolve.mainFields == null) { - if (config.consumer === 'client' || opts.isSsrTargetWebworker) { + if (config.consumer === 'client' || name === 'client' || opts.isSsrTargetWebworker) { config.resolve.mainFields = [...defaultClientMainFields]; } else { config.resolve.mainFields = [...defaultServerMainFields]; @@ -622,13 +623,14 @@ export function ensureConfigEnvironmentMainFields(config, opts) { /** * Mutates `config` to ensure `resolve.conditions` is set. If unset, it emulates Vite's default fallback. + * @param {string} name * @param {import('vite').EnvironmentOptions} config * @param {{ isSsrTargetWebworker?: boolean }} opts */ -export function ensureConfigEnvironmentConditions(config, opts) { +export function ensureConfigEnvironmentConditions(name, config, opts) { config.resolve ??= {}; if (config.resolve.conditions == null) { - if (config.consumer === 'client' || opts.isSsrTargetWebworker) { + if (config.consumer === 'client' || name === 'client' || opts.isSsrTargetWebworker) { config.resolve.conditions = [...defaultClientConditions]; } else { config.resolve.conditions = [...defaultServerConditions]; From dd7a9cf37f0de5453877b87b681315dfcfe049e2 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 21 Nov 2024 21:46:17 +0800 Subject: [PATCH 11/14] chore: noExternal esm-env --- packages/e2e-tests/kit-node/__tests__/kit.spec.ts | 3 ++- packages/vite-plugin-svelte/src/utils/options.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts index 48bf7c210..f9df86270 100644 --- a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts +++ b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts @@ -285,7 +285,8 @@ describe('kit-node', () => { '/^svelte\\//', // serialized with toString 'e2e-test-dep-svelte-api-only', 'svelte-i18n', - 'esm-env', + 'esm-env', // first added by svelte-kit + 'esm-env', // second added by vite-plugin-svelte '@sveltejs/kit' ], `ssr.noExternal in ${filename}` diff --git a/packages/vite-plugin-svelte/src/utils/options.js b/packages/vite-plugin-svelte/src/utils/options.js index ce9892c51..6582e6e7e 100644 --- a/packages/vite-plugin-svelte/src/utils/options.js +++ b/packages/vite-plugin-svelte/src/utils/options.js @@ -572,6 +572,11 @@ function buildExtraConfigForSvelte(config) { if (!isDepExternaled('svelte', config.ssr?.external ?? [])) { noExternal.push('svelte', /^svelte\//); } + // esm-env needs to be bundled by default for the development/production condition + // be properly used by svelte + if (!isDepExternaled('esm-env', config.ssr?.external ?? [])) { + noExternal.push('esm-env'); + } return { optimizeDeps: { include, exclude }, ssr: { noExternal, external } }; } From 6d22716df459cfaf2450210b1e3b94f37a5d081e Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 21 Nov 2024 21:49:11 +0800 Subject: [PATCH 12/14] chore: add changeset --- .changeset/itchy-lions-whisper.md | 5 +++++ .changeset/light-phones-happen.md | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/itchy-lions-whisper.md create mode 100644 .changeset/light-phones-happen.md diff --git a/.changeset/itchy-lions-whisper.md b/.changeset/itchy-lions-whisper.md new file mode 100644 index 000000000..cb8695d97 --- /dev/null +++ b/.changeset/itchy-lions-whisper.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/vite-plugin-svelte': minor +--- + +Add `esm-env` to `ssr.noExternal` by default to resolve its conditions with Vite diff --git a/.changeset/light-phones-happen.md b/.changeset/light-phones-happen.md new file mode 100644 index 000000000..6cd72e8af --- /dev/null +++ b/.changeset/light-phones-happen.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/vite-plugin-svelte': major +--- + +Handle Vite 6 breaking change and remove Vite 5 handling From 5fbbe19a8a7172918f595808f2c93569ca711fbf Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 21 Nov 2024 21:52:35 +0800 Subject: [PATCH 13/14] chore: update types --- packages/vite-plugin-svelte/types/index.d.ts.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite-plugin-svelte/types/index.d.ts.map b/packages/vite-plugin-svelte/types/index.d.ts.map index f45ed2c62..42b505c6b 100644 --- a/packages/vite-plugin-svelte/types/index.d.ts.map +++ b/packages/vite-plugin-svelte/types/index.d.ts.map @@ -22,5 +22,5 @@ null, null ], - "mappings": ";;;;aAIYA,OAAOA;;;;;;;;;;;;;kBAaFC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGbC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFZC,qBAAqBA;;;;;;;;;;;;;iBC1KtBC,MAAMA;iBCTNC,cAAcA;iBCgBRC,gBAAgBA" + "mappings": ";;;;aAIYA,OAAOA;;;;;;;;;;;;;kBAaFC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGbC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFZC,qBAAqBA;;;;;;;;;;;;;iBCxKtBC,MAAMA;iBCXNC,cAAcA;iBCgBRC,gBAAgBA" } \ No newline at end of file From 641301dc430a8cd1daf68620c23adfe7c51b4d9d Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 21 Nov 2024 22:52:08 +0800 Subject: [PATCH 14/14] chore: update test --- packages/e2e-tests/kit-node/__tests__/kit.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts index f9df86270..b1e4c4858 100644 --- a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts +++ b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts @@ -16,6 +16,7 @@ import { import glob from 'tiny-glob'; import path from 'node:path'; +import { defaultClientConditions, defaultClientMainFields } from 'vite'; import { describe, expect, it } from 'vitest'; describe('kit-node', () => { @@ -347,12 +348,12 @@ describe('kit-node', () => { expectArrayEqual(config.resolve.dedupe, expectedDedupe, `resolve.dedupe in ${filename}`); expectArrayEqual( config.resolve.mainFields, - ['svelte', 'browser', 'module', 'jsnext:main', 'jsnext'], + ['svelte', ...defaultClientMainFields], `resolve.mainFields in ${filename}` ); expectArrayEqual( config.resolve.conditions, - ['browser', 'development|production', 'module', 'svelte'], + [...defaultClientConditions, 'svelte'], `resolve.conditions in ${filename}` ); }