Skip to content

Commit ae82e2d

Browse files
committed
chore: merge main
2 parents 39a3aa5 + 075caa0 commit ae82e2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+970
-612
lines changed

docs/config/dep-optimization-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Unless noted, the options in this section are only applied to the dependency opt
1010

1111
By default, Vite will crawl all your `.html` files to detect dependencies that need to be pre-bundled (ignoring `node_modules`, `build.outDir`, `__tests__` and `coverage`). If `build.rollupOptions.input` is specified, Vite will crawl those entry points instead.
1212

13-
If neither of these fit your needs, you can specify custom entries using this option - the value should be a [`tinyglobby` pattern](https://github.com/SuperchupuDev/tinyglobby) or array of patterns that are relative from Vite project root. This will overwrite default entries inference. Only `node_modules` and `build.outDir` folders will be ignored by default when `optimizeDeps.entries` is explicitly defined. If other folders need to be ignored, you can use an ignore pattern as part of the entries list, marked with an initial `!`. `node_modules` will not be ignored for patterns that explicitly include the string `node_modules`.
13+
If neither of these fit your needs, you can specify custom entries using this option - the value should be a [`tinyglobby` pattern](https://superchupu.dev/tinyglobby/comparison) or array of patterns that are relative from Vite project root. This will overwrite default entries inference. Only `node_modules` and `build.outDir` folders will be ignored by default when `optimizeDeps.entries` is explicitly defined. If other folders need to be ignored, you can use an ignore pattern as part of the entries list, marked with an initial `!`. `node_modules` will not be ignored for patterns that explicitly include the string `node_modules`.
1414

1515
## optimizeDeps.exclude <NonInheritBadge />
1616

docs/config/server-options.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ Set to `true` to exit if port is already in use, instead of automatically trying
9292

9393
Enable TLS + HTTP/2. The value is an [options object](https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener) passed to `https.createServer()`.
9494

95-
Note that this downgrades to TLS only when the [`server.proxy` option](#server-proxy) is also used.
96-
9795
A valid certificate is needed. For a basic setup, you can add [@vitejs/plugin-basic-ssl](https://github.com/vitejs/vite-plugin-basic-ssl) to the project plugins, which will automatically create and cache a self-signed certificate. But we recommend creating your own certificates.
9896

9997
## server.open
@@ -233,7 +231,7 @@ The error that appears in the Browser when the fallback happens can be ignored.
233231

234232
Warm up files to transform and cache the results in advance. This improves the initial page load during server starts and prevents transform waterfalls.
235233

236-
`clientFiles` are files that are used in the client only, while `ssrFiles` are files that are used in SSR only. They accept an array of file paths or [`tinyglobby`](https://github.com/SuperchupuDev/tinyglobby) patterns relative to the `root`.
234+
`clientFiles` are files that are used in the client only, while `ssrFiles` are files that are used in SSR only. They accept an array of file paths or [`tinyglobby` patterns](https://superchupu.dev/tinyglobby/comparison) relative to the `root`.
237235

238236
Make sure to only add files that are frequently used to not overload the Vite dev server on startup.
239237

docs/guide/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ Note that:
619619

620620
- This is a Vite-only feature and is not a web or ES standard.
621621
- The glob patterns are treated like import specifiers: they must be either relative (start with `./`) or absolute (start with `/`, resolved relative to project root) or an alias path (see [`resolve.alias` option](/config/shared-options.md#resolve-alias)).
622-
- The glob matching is done via [`tinyglobby`](https://github.com/SuperchupuDev/tinyglobby).
622+
- The glob matching is done via [`tinyglobby`](https://github.com/SuperchupuDev/tinyglobby) - check out its documentation for [supported glob patterns](https://superchupu.dev/tinyglobby/comparison).
623623
- You should also be aware that all the arguments in the `import.meta.glob` must be **passed as literals**. You can NOT use variables or expressions in them.
624624

625625
## Dynamic Import

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default defineConfig(
3939
parserOptions: {
4040
sourceType: 'module',
4141
ecmaVersion: 2022,
42+
isolatedDeclarations: true,
4243
project: shouldTypeCheck
4344
? [
4445
'./packages/*/tsconfig.json',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"picocolors": "^1.1.1",
6666
"playwright-chromium": "^1.56.1",
6767
"prettier": "3.6.2",
68-
"rolldown": "^1.0.0-beta.43",
68+
"rolldown": "^1.0.0-beta.44",
6969
"rollup": "^4.43.0",
7070
"simple-git-hooks": "^2.13.1",
7171
"tsx": "^4.20.6",

packages/create-vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
"cross-spawn": "^7.0.6",
3838
"mri": "^1.2.0",
3939
"picocolors": "^1.1.1",
40-
"tsdown": "^0.15.7"
40+
"tsdown": "^0.15.8"
4141
}
4242
}

packages/plugin-legacy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"acorn": "^8.15.0",
6262
"fdir": "^6.5.0",
6363
"picocolors": "^1.1.1",
64-
"tsdown": "^0.15.7",
64+
"tsdown": "^0.15.8",
6565
"vite": "workspace:*"
6666
}
6767
}

packages/plugin-legacy/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ function wrapIIFEBabelPlugin(): BabelPlugin {
10041004
}
10051005
}
10061006

1007-
export const cspHashes = [
1007+
export const cspHashes: string[] = [
10081008
safari10NoModuleFix,
10091009
systemJSInlineCode,
10101010
detectModernBrowserCode,
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// https://gist.github.com/samthor/64b114e4a4f539915a95b91ffd340acc
22
// DO NOT ALTER THIS CONTENT
3-
export const safari10NoModuleFix = `!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();`
3+
export const safari10NoModuleFix: string = `!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();`
44

5-
export const legacyPolyfillId = 'vite-legacy-polyfill'
6-
export const legacyEntryId = 'vite-legacy-entry'
7-
export const systemJSInlineCode = `System.import(document.getElementById('${legacyEntryId}').getAttribute('data-src'))`
5+
export const legacyPolyfillId: string = 'vite-legacy-polyfill'
6+
export const legacyEntryId: string = 'vite-legacy-entry'
7+
export const systemJSInlineCode: string = `System.import(document.getElementById('${legacyEntryId}').getAttribute('data-src'))`
88

99
const detectModernBrowserVarName = '__vite_is_modern_browser'
10-
export const detectModernBrowserDetector = `import.meta.url;import("_").catch(()=>1);(async function*(){})().next()`
11-
export const detectModernBrowserCode = `${detectModernBrowserDetector};window.${detectModernBrowserVarName}=true`
12-
export const dynamicFallbackInlineCode = `!function(){if(window.${detectModernBrowserVarName})return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("${legacyPolyfillId}"),n=document.createElement("script");n.src=e.src,n.onload=function(){${systemJSInlineCode}},document.body.appendChild(n)}();`
10+
export const detectModernBrowserDetector: string = `import.meta.url;import("_").catch(()=>1);(async function*(){})().next()`
11+
export const detectModernBrowserCode: string = `${detectModernBrowserDetector};window.${detectModernBrowserVarName}=true`
12+
export const dynamicFallbackInlineCode: string = `!function(){if(window.${detectModernBrowserVarName})return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("${legacyPolyfillId}"),n=document.createElement("script");n.src=e.src,n.onload=function(){${systemJSInlineCode}},document.body.appendChild(n)}();`
1313

14-
export const modernChunkLegacyGuard = `export function __vite_legacy_guard(){${detectModernBrowserDetector}};`
14+
export const modernChunkLegacyGuard: string = `export function __vite_legacy_guard(){${detectModernBrowserDetector}};`

packages/plugin-legacy/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
2-
"include": ["tsdown.config.ts", "src"],
2+
"include": ["src"],
33
"exclude": ["**/*.spec.ts"],
44
"compilerOptions": {
55
"outDir": "dist",
66
"target": "ES2023",
77
"module": "Preserve",
88
"moduleResolution": "bundler",
9-
"strict": true,
9+
"isolatedDeclarations": true,
1010
"declaration": true,
11+
"strict": true,
1112
"sourceMap": true,
1213
"noUnusedLocals": true,
1314
"esModuleInterop": true,

0 commit comments

Comments
 (0)