vite 6.0.0-beta.2 → 6.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +61 -943
- package/README.md +4 -4
- package/bin/vite.js +5 -0
- package/dist/client/client.mjs +5 -5
- package/dist/node/chunks/dep-BkDduZ8N.js +1099 -0
- package/dist/node/chunks/{dep-D-7KCb9p.js → dep-CdoEeCn3.js} +704 -439
- package/dist/node/chunks/{dep-BHXIdTzn.js → dep-Cpgpmu8-.js} +30526 -36819
- package/dist/node/chunks/dep-Cq6WeEUK.js +7216 -0
- package/dist/node/chunks/dep-mtw2NpNs.js +589 -0
- package/dist/node/cli.js +18 -34
- package/dist/node/index.d.ts +118 -100
- package/dist/node/index.js +6 -7
- package/dist/node/module-runner.d.ts +4 -4
- package/dist/node/module-runner.js +11 -11
- package/dist/node-cjs/publicUtils.cjs +2777 -2683
- package/index.cjs +1 -1
- package/index.d.cts +1 -1
- package/package.json +17 -17
- package/dist/node/chunks/dep-BabmomGK.js +0 -993
- package/dist/node/chunks/dep-DTHr9Se7.js +0 -6843
- package/dist/node/chunks/dep-IQS-Za7F.js +0 -561
package/README.md
CHANGED
@@ -11,10 +11,10 @@
|
|
11
11
|
|
12
12
|
Vite (French word for "fast", pronounced `/vit/`) is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts:
|
13
13
|
|
14
|
-
- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://
|
14
|
+
- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vite.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vite.dev/guide/features.html#hot-module-replacement).
|
15
15
|
|
16
|
-
- A [build command](https://
|
16
|
+
- A [build command](https://vite.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production.
|
17
17
|
|
18
|
-
In addition, Vite is highly extensible via its [Plugin API](https://
|
18
|
+
In addition, Vite is highly extensible via its [Plugin API](https://vite.dev/guide/api-plugin.html) and [JavaScript API](https://vite.dev/guide/api-javascript.html) with full typing support.
|
19
19
|
|
20
|
-
[Read the Docs to Learn More](https://
|
20
|
+
[Read the Docs to Learn More](https://vite.dev).
|
package/bin/vite.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import { performance } from 'node:perf_hooks'
|
3
|
+
import module from 'node:module'
|
3
4
|
|
4
5
|
if (!import.meta.url.includes('node_modules')) {
|
5
6
|
try {
|
@@ -41,6 +42,10 @@ if (debugIndex > 0) {
|
|
41
42
|
}
|
42
43
|
|
43
44
|
function start() {
|
45
|
+
try {
|
46
|
+
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.8.0+ and only called if it exists
|
47
|
+
module.enableCompileCache?.()
|
48
|
+
} catch {}
|
44
49
|
return import('../dist/node/cli.js')
|
45
50
|
}
|
46
51
|
|
package/dist/client/client.mjs
CHANGED
@@ -155,7 +155,7 @@ class HMRClient {
|
|
155
155
|
}
|
156
156
|
// After an HMR update, some modules are no longer imported on the page
|
157
157
|
// but they may have left behind side effects that need to be cleaned up
|
158
|
-
// (
|
158
|
+
// (e.g. style injections)
|
159
159
|
async prunePaths(paths) {
|
160
160
|
await Promise.all(
|
161
161
|
paths.map((path) => {
|
@@ -514,14 +514,14 @@ try {
|
|
514
514
|
your current setup:
|
515
515
|
(browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)
|
516
516
|
(browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)
|
517
|
-
Check out your Vite / network configuration and https://
|
517
|
+
Check out your Vite / network configuration and https://vite.dev/config/server-options.html#server-hmr .`
|
518
518
|
);
|
519
519
|
});
|
520
520
|
socket.addEventListener(
|
521
521
|
"open",
|
522
522
|
() => {
|
523
523
|
console.info(
|
524
|
-
"[vite] Direct websocket connection fallback. Check out https://
|
524
|
+
"[vite] Direct websocket connection fallback. Check out https://vite.dev/config/server-options.html#server-hmr to remove the previous connection error."
|
525
525
|
);
|
526
526
|
},
|
527
527
|
{ once: true }
|
@@ -562,7 +562,7 @@ function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) {
|
|
562
562
|
return socket2;
|
563
563
|
}
|
564
564
|
function cleanUrl(pathname) {
|
565
|
-
const url = new URL(pathname, "http://
|
565
|
+
const url = new URL(pathname, "http://vite.dev");
|
566
566
|
url.searchParams.delete("direct");
|
567
567
|
return url.pathname + url.search;
|
568
568
|
}
|
@@ -822,7 +822,7 @@ function injectQuery(url, queryToInject) {
|
|
822
822
|
return url;
|
823
823
|
}
|
824
824
|
const pathname = url.replace(/[?#].*$/, "");
|
825
|
-
const { search, hash } = new URL(url, "http://
|
825
|
+
const { search, hash } = new URL(url, "http://vite.dev");
|
826
826
|
return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash || ""}`;
|
827
827
|
}
|
828
828
|
|