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/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://vitejs.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vitejs.dev/guide/features.html#hot-module-replacement).
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://vitejs.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production.
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://vitejs.dev/guide/api-plugin.html) and [JavaScript API](https://vitejs.dev/guide/api-javascript.html) with full typing support.
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://vitejs.dev).
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
 
@@ -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
- // (.e.g style injections)
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://vitejs.dev/config/server-options.html#server-hmr .`
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://vitejs.dev/config/server-options.html#server-hmr to remove the previous connection error."
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://vitejs.dev");
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://vitejs.dev");
825
+ const { search, hash } = new URL(url, "http://vite.dev");
826
826
  return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash || ""}`;
827
827
  }
828
828