vite 5.4.6 → 5.4.18
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 +1 -1
- package/README.md +4 -4
- package/dist/client/client.mjs +9 -5
- package/dist/node/chunks/{dep-CxMW8ntG.js → dep-75Pw0qnz.js} +1 -1
- package/dist/node/chunks/{dep-DyBnyoVI.js → dep-DbT5NFX0.js} +379 -104
- package/dist/node/chunks/{dep-Due-rusG.js → dep-nOVVHa2_.js} +267 -106
- package/dist/node/cli.js +7 -6
- package/dist/node/constants.js +2 -1
- package/dist/node/index.d.ts +47 -0
- package/dist/node/index.js +4 -3
- package/index.cjs +1 -1
- package/index.d.cts +1 -1
- package/package.json +4 -4
package/LICENSE.md
CHANGED
@@ -3,7 +3,7 @@ Vite is released under the MIT license:
|
|
3
3
|
|
4
4
|
MIT License
|
5
5
|
|
6
|
-
Copyright (c) 2019-present,
|
6
|
+
Copyright (c) 2019-present, VoidZero Inc. and Vite contributors
|
7
7
|
|
8
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
9
|
of this software and associated documentation files (the "Software"), to deal
|
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/dist/client/client.mjs
CHANGED
@@ -500,6 +500,7 @@ const hmrPort = __HMR_PORT__;
|
|
500
500
|
const socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${hmrPort || importMetaUrl.port}${__HMR_BASE__}`;
|
501
501
|
const directSocketHost = __HMR_DIRECT_TARGET__;
|
502
502
|
const base = __BASE__ || "/";
|
503
|
+
const wsToken = __WS_TOKEN__;
|
503
504
|
let socket;
|
504
505
|
try {
|
505
506
|
let fallback;
|
@@ -513,14 +514,14 @@ try {
|
|
513
514
|
your current setup:
|
514
515
|
(browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)
|
515
516
|
(browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)
|
516
|
-
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 .`
|
517
518
|
);
|
518
519
|
});
|
519
520
|
socket.addEventListener(
|
520
521
|
"open",
|
521
522
|
() => {
|
522
523
|
console.info(
|
523
|
-
"[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."
|
524
525
|
);
|
525
526
|
},
|
526
527
|
{ once: true }
|
@@ -532,7 +533,10 @@ Check out your Vite / network configuration and https://vitejs.dev/config/server
|
|
532
533
|
console.error(`[vite] failed to connect to websocket (${error}). `);
|
533
534
|
}
|
534
535
|
function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) {
|
535
|
-
const socket2 = new WebSocket(
|
536
|
+
const socket2 = new WebSocket(
|
537
|
+
`${protocol}://${hostAndPath}?token=${wsToken}`,
|
538
|
+
"vite-hmr"
|
539
|
+
);
|
536
540
|
let isOpened = false;
|
537
541
|
socket2.addEventListener(
|
538
542
|
"open",
|
@@ -561,7 +565,7 @@ function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) {
|
|
561
565
|
return socket2;
|
562
566
|
}
|
563
567
|
function cleanUrl(pathname) {
|
564
|
-
const url = new URL(pathname, "http://
|
568
|
+
const url = new URL(pathname, "http://vite.dev");
|
565
569
|
url.searchParams.delete("direct");
|
566
570
|
return url.pathname + url.search;
|
567
571
|
}
|
@@ -818,7 +822,7 @@ function injectQuery(url, queryToInject) {
|
|
818
822
|
return url;
|
819
823
|
}
|
820
824
|
const pathname = url.replace(/[?#].*$/, "");
|
821
|
-
const { search, hash } = new URL(url, "http://
|
825
|
+
const { search, hash } = new URL(url, "http://vite.dev");
|
822
826
|
return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash || ""}`;
|
823
827
|
}
|
824
828
|
|