Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/.vitepress/theme/components/YouTubeVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ defineProps({
:src="`https://www.youtube.com/embed/${videoId}`"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allow="
accelerometer;
autoplay;
clipboard-write;
encrypted-media;
gyroscope;
picture-in-picture;
"
allowfullscreen
></iframe>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"docs-serve": "vitepress serve"
},
"devDependencies": {
"@shikijs/vitepress-twoslash": "^3.15.0",
"@shikijs/vitepress-twoslash": "^3.17.0",
"@types/express": "^5.0.5",
"feed": "^5.1.0",
"gsap": "^3.13.0",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-n": "^17.23.1",
"eslint-plugin-regexp": "^2.10.0",
"execa": "^9.6.0",
"execa": "^9.6.1",
"globals": "^16.5.0",
"lint-staged": "^16.2.7",
"picocolors": "^1.1.1",
"playwright-chromium": "^1.57.0",
"prettier": "3.6.2",
"prettier": "3.7.3",
"rolldown": "^1.0.0-beta.52",
"rollup": "^4.43.0",
"simple-git-hooks": "^2.13.1",
"tsx": "^4.20.6",
"tsx": "^4.21.0",
"typescript": "~5.9.2",
"typescript-eslint": "^8.48.0",
"vite": "workspace:*",
Expand All @@ -95,7 +95,7 @@
"eslint --cache --fix"
]
},
"packageManager": "pnpm@10.23.0",
"packageManager": "pnpm@10.24.0",
"stackblitz": {
"startCommand": "pnpm --filter='./packages/vite' run dev"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ async function init() {

if (useRolldownVite) {
// renovate: datasource=npm depName=rolldown-vite
const rolldownViteVersion = '7.2.7'
const rolldownViteVersion = '7.2.8'
const pkgVersion = `npm:rolldown-vite@${rolldownViteVersion}`
pkg.devDependencies.vite = pkgVersion
switch (pkgManager) {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-svelte-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@tsconfig/svelte": "^5.0.6",
"@types/node": "^24.10.1",
"svelte": "^5.44.1",
"svelte": "^5.45.2",
"svelte-check": "^4.3.4",
"typescript": "~5.9.3",
"vite": "^7.2.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"svelte": "^5.44.1",
"svelte": "^5.45.2",
"vite": "^7.2.4"
}
}
5 changes: 2 additions & 3 deletions packages/plugin-legacy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,8 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {

if (options.modernTargets) {
// Package is ESM only
const { default: browserslistToEsbuild } = await import(
'browserslist-to-esbuild'
)
const { default: browserslistToEsbuild } =
await import('browserslist-to-esbuild')
config.build.target = browserslistToEsbuild(options.modernTargets)
} else {
config.build.target = modernTargetsEsbuild
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@types/escape-html": "^1.0.4",
"@types/pnpapi": "^0.0.5",
"artichokie": "^0.4.2",
"baseline-browser-mapping": "^2.8.31",
"baseline-browser-mapping": "^2.8.32",
"cac": "^6.7.14",
"chokidar": "^3.6.0",
"connect": "^3.7.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/vite/src/node/__tests__/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,8 @@ describe('isFileReadable', () => {
expect(isFileReadable('/does_not_exist')).toBe(false)
})

const testFile = require.resolve(
'./utils/isFileReadable/permission-test-file',
)
const testFile =
require.resolve('./utils/isFileReadable/permission-test-file')
test('file with normal permission', async () => {
expect(isFileReadable(testFile)).toBe(true)
})
Expand Down
10 changes: 6 additions & 4 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,15 @@ export type ResolveModulePreloadDependenciesFn = (
},
) => string[]

export interface ResolvedBuildEnvironmentOptions
extends Required<Omit<BuildEnvironmentOptions, 'polyfillModulePreload'>> {
export interface ResolvedBuildEnvironmentOptions extends Required<
Omit<BuildEnvironmentOptions, 'polyfillModulePreload'>
> {
modulePreload: false | ResolvedModulePreloadOptions
}

export interface ResolvedBuildOptions
extends Required<Omit<BuildOptions, 'polyfillModulePreload'>> {
export interface ResolvedBuildOptions extends Required<
Omit<BuildOptions, 'polyfillModulePreload'>
> {
modulePreload: false | ResolvedModulePreloadOptions
}

Expand Down
187 changes: 93 additions & 94 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,100 +550,99 @@ export interface InlineConfig extends UserConfig {
forceOptimizeDeps?: boolean
}

export interface ResolvedConfig
extends Readonly<
Omit<
UserConfig,
| 'plugins'
| 'css'
| 'json'
| 'assetsInclude'
| 'optimizeDeps'
| 'worker'
| 'build'
| 'dev'
| 'environments'
| 'experimental'
| 'future'
| 'server'
| 'preview'
> & {
configFile: string | undefined
configFileDependencies: string[]
inlineConfig: InlineConfig
root: string
base: string
/** @internal */
decodedBase: string
/** @internal */
rawBase: string
publicDir: string
cacheDir: string
command: 'build' | 'serve'
mode: string
isWorker: boolean
// in nested worker bundle to find the main config
/** @internal */
mainConfig: ResolvedConfig | null
/** @internal list of bundle entry id. used to detect recursive worker bundle. */
bundleChain: string[]
isProduction: boolean
envDir: string | false
env: Record<string, any>
resolve: Required<ResolveOptions> & {
alias: Alias[]
}
plugins: readonly Plugin[]
css: ResolvedCSSOptions
json: Required<JsonOptions>
esbuild: ESBuildOptions | false
server: ResolvedServerOptions
dev: ResolvedDevEnvironmentOptions
/** @experimental */
builder: ResolvedBuilderOptions | undefined
build: ResolvedBuildOptions
preview: ResolvedPreviewOptions
ssr: ResolvedSSROptions
assetsInclude: (file: string) => boolean
logger: Logger
/**
* Create an internal resolver to be used in special scenarios, e.g.
* optimizer & handling css `@imports`.
*
* This API is deprecated. It only works for the client and ssr
* environments. The `aliasOnly` option is also not being used anymore.
* Plugins should move to `createIdResolver(environment.config)` instead.
*
* @deprecated Use `createIdResolver` from `vite` instead.
*/
createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn
optimizeDeps: DepOptimizationOptions
/** @internal */
packageCache: PackageCache
worker: ResolvedWorkerOptions
appType: AppType
experimental: RequiredExceptFor<ExperimentalOptions, 'renderBuiltUrl'>
future: FutureOptions | undefined
environments: Record<string, ResolvedEnvironmentOptions>
/**
* The token to connect to the WebSocket server from browsers.
*
* We recommend using `import.meta.hot` rather than connecting
* to the WebSocket server directly.
* If you have a usecase that requires connecting to the WebSocket
* server, please create an issue so that we can discuss.
*
* @deprecated
*/
webSocketToken: string
/** @internal */
fsDenyGlob: AnymatchFn
/** @internal */
safeModulePaths: Set<string>
/** @internal */
[SYMBOL_RESOLVED_CONFIG]: true
} & PluginHookUtils
> {}
export interface ResolvedConfig extends Readonly<
Omit<
UserConfig,
| 'plugins'
| 'css'
| 'json'
| 'assetsInclude'
| 'optimizeDeps'
| 'worker'
| 'build'
| 'dev'
| 'environments'
| 'experimental'
| 'future'
| 'server'
| 'preview'
> & {
configFile: string | undefined
configFileDependencies: string[]
inlineConfig: InlineConfig
root: string
base: string
/** @internal */
decodedBase: string
/** @internal */
rawBase: string
publicDir: string
cacheDir: string
command: 'build' | 'serve'
mode: string
isWorker: boolean
// in nested worker bundle to find the main config
/** @internal */
mainConfig: ResolvedConfig | null
/** @internal list of bundle entry id. used to detect recursive worker bundle. */
bundleChain: string[]
isProduction: boolean
envDir: string | false
env: Record<string, any>
resolve: Required<ResolveOptions> & {
alias: Alias[]
}
plugins: readonly Plugin[]
css: ResolvedCSSOptions
json: Required<JsonOptions>
esbuild: ESBuildOptions | false
server: ResolvedServerOptions
dev: ResolvedDevEnvironmentOptions
/** @experimental */
builder: ResolvedBuilderOptions | undefined
build: ResolvedBuildOptions
preview: ResolvedPreviewOptions
ssr: ResolvedSSROptions
assetsInclude: (file: string) => boolean
logger: Logger
/**
* Create an internal resolver to be used in special scenarios, e.g.
* optimizer & handling css `@imports`.
*
* This API is deprecated. It only works for the client and ssr
* environments. The `aliasOnly` option is also not being used anymore.
* Plugins should move to `createIdResolver(environment.config)` instead.
*
* @deprecated Use `createIdResolver` from `vite` instead.
*/
createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn
optimizeDeps: DepOptimizationOptions
/** @internal */
packageCache: PackageCache
worker: ResolvedWorkerOptions
appType: AppType
experimental: RequiredExceptFor<ExperimentalOptions, 'renderBuiltUrl'>
future: FutureOptions | undefined
environments: Record<string, ResolvedEnvironmentOptions>
/**
* The token to connect to the WebSocket server from browsers.
*
* We recommend using `import.meta.hot` rather than connecting
* to the WebSocket server directly.
* If you have a usecase that requires connecting to the WebSocket
* server, please create an issue so that we can discuss.
*
* @deprecated
*/
webSocketToken: string
/** @internal */
fsDenyGlob: AnymatchFn
/** @internal */
safeModulePaths: Set<string>
/** @internal */
[SYMBOL_RESOLVED_CONFIG]: true
} & PluginHookUtils
> {}

// inferred ones are omitted
const configDefaults = Object.freeze({
Expand Down
12 changes: 8 additions & 4 deletions packages/vite/src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,17 @@ export interface PluginContextMetaExtension {
viteVersion: string
}

export interface ConfigPluginContext
extends Omit<MinimalPluginContext, 'meta' | 'environment'> {
export interface ConfigPluginContext extends Omit<
MinimalPluginContext,
'meta' | 'environment'
> {
meta: Omit<PluginContextMeta, 'watchMode'>
}

export interface MinimalPluginContextWithoutEnvironment
extends Omit<MinimalPluginContext, 'environment'> {}
export interface MinimalPluginContextWithoutEnvironment extends Omit<
MinimalPluginContext,
'environment'
> {}

// Augment Rollup types to have the PluginContextExtension
declare module 'rollup' {
Expand Down
6 changes: 2 additions & 4 deletions packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,12 @@ interface ResolvePluginOptions {
}

export interface InternalResolveOptions
extends Required<ResolveOptions>,
ResolvePluginOptions {}
extends Required<ResolveOptions>, ResolvePluginOptions {}

// Defined ResolveOptions are used to overwrite the values for all environments
// It is used when creating custom resolvers (for CSS, scanning, etc)
export interface ResolvePluginOptionsWithOverrides
extends ResolveOptions,
ResolvePluginOptions {}
extends ResolveOptions, ResolvePluginOptions {}

export function resolvePlugin(
resolveOptions: ResolvePluginOptionsWithOverrides,
Expand Down
6 changes: 4 additions & 2 deletions packages/vite/src/node/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ import type { MinimalPluginContextWithoutEnvironment } from './plugin'

export interface PreviewOptions extends CommonServerOptions {}

export interface ResolvedPreviewOptions
extends RequiredExceptFor<PreviewOptions, 'host' | 'https' | 'proxy'> {}
export interface ResolvedPreviewOptions extends RequiredExceptFor<
PreviewOptions,
'host' | 'https' | 'proxy'
> {}

export function resolvePreviewOptions(
preview: PreviewOptions | undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export function createRunnableDevEnvironment(
return new RunnableDevEnvironment(name, config, context)
}

export interface RunnableDevEnvironmentContext
extends Omit<DevEnvironmentContext, 'hot'> {
export interface RunnableDevEnvironmentContext extends Omit<
DevEnvironmentContext,
'hot'
> {
runner?: (
environment: RunnableDevEnvironment,
options?: ServerModuleRunnerOptions,
Expand Down
Loading