vite 6.0.0-beta.4 → 6.0.0-beta.6

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 CHANGED
@@ -2518,24 +2518,3 @@ Repository: git+https://github.com/websockets/ws.git
2518
2518
  > COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
2519
2519
  > IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2520
2520
  > CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2521
-
2522
- ---------------------------------------
2523
-
2524
- ## yaml
2525
- License: ISC
2526
- By: Eemeli Aro
2527
- Repository: github:eemeli/yaml
2528
-
2529
- > Copyright Eemeli Aro <eemeli@gmail.com>
2530
- >
2531
- > Permission to use, copy, modify, and/or distribute this software for any purpose
2532
- > with or without fee is hereby granted, provided that the above copyright notice
2533
- > and this permission notice appear in all copies.
2534
- >
2535
- > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2536
- > REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
2537
- > FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2538
- > INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
2539
- > OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
2540
- > TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
2541
- > THIS SOFTWARE.
@@ -730,22 +730,29 @@ function hasErrorOverlay() {
730
730
  return document.querySelectorAll(overlayId).length;
731
731
  }
732
732
  async function waitForSuccessfulPing(socketProtocol2, hostAndPath, ms = 1e3) {
733
- const pingHostProtocol = socketProtocol2 === "wss" ? "https" : "http";
734
- const ping = async () => {
735
- try {
736
- await fetch(`${pingHostProtocol}://${hostAndPath}`, {
737
- mode: "no-cors",
738
- headers: {
739
- // Custom headers won't be included in a request with no-cors so (ab)use one of the
740
- // safelisted headers to identify the ping request
741
- Accept: "text/x-vite-ping"
742
- }
743
- });
744
- return true;
745
- } catch {
746
- }
747
- return false;
748
- };
733
+ async function ping() {
734
+ const socket2 = new WebSocket(
735
+ `${socketProtocol2}://${hostAndPath}`,
736
+ "vite-ping"
737
+ );
738
+ return new Promise((resolve) => {
739
+ function onOpen() {
740
+ resolve(true);
741
+ close();
742
+ }
743
+ function onError() {
744
+ resolve(false);
745
+ close();
746
+ }
747
+ function close() {
748
+ socket2.removeEventListener("open", onOpen);
749
+ socket2.removeEventListener("error", onError);
750
+ socket2.close();
751
+ }
752
+ socket2.addEventListener("open", onOpen);
753
+ socket2.addEventListener("error", onError);
754
+ });
755
+ }
749
756
  if (await ping()) {
750
757
  return;
751
758
  }
@@ -1,4 +1,4 @@
1
- import { M as commonjsGlobal, L as getDefaultExportFromCjs } from './dep-Cpgpmu8-.js';
1
+ import { M as commonjsGlobal, L as getDefaultExportFromCjs } from './dep-D4jOq5eU.js';
2
2
  import require$$0$3 from 'fs';
3
3
  import require$$0$1 from 'postcss';
4
4
  import require$$0 from 'path';