vite 5.0.7 → 5.0.9

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.
@@ -1,4 +1,4 @@
1
- import { z as commonjsGlobal, y as getDefaultExportFromCjs } from './dep-wTaJK0Jt.js';
1
+ import { z as commonjsGlobal, y as getDefaultExportFromCjs } from './dep-Pluk1iaB.js';
2
2
  import require$$0__default from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
@@ -1,4 +1,4 @@
1
- import { y as getDefaultExportFromCjs } from './dep-wTaJK0Jt.js';
1
+ import { y as getDefaultExportFromCjs } from './dep-Pluk1iaB.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-8a-6Quh6.js';
package/dist/node/cli.js CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import fs from 'node:fs';
3
3
  import { performance } from 'node:perf_hooks';
4
4
  import { EventEmitter } from 'events';
5
- import { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-wTaJK0Jt.js';
5
+ import { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-Pluk1iaB.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -759,7 +759,7 @@ cli
759
759
  filterDuplicateOptions(options);
760
760
  // output structure is preserved even after bundling so require()
761
761
  // is ok here
762
- const { createServer } = await import('./chunks/dep-wTaJK0Jt.js').then(function (n) { return n.A; });
762
+ const { createServer } = await import('./chunks/dep-Pluk1iaB.js').then(function (n) { return n.A; });
763
763
  try {
764
764
  const server = await createServer({
765
765
  root,
@@ -839,7 +839,7 @@ cli
839
839
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
840
840
  .action(async (root, options) => {
841
841
  filterDuplicateOptions(options);
842
- const { build } = await import('./chunks/dep-wTaJK0Jt.js').then(function (n) { return n.C; });
842
+ const { build } = await import('./chunks/dep-Pluk1iaB.js').then(function (n) { return n.C; });
843
843
  const buildOptions = cleanOptions(options);
844
844
  try {
845
845
  await build({
@@ -867,7 +867,7 @@ cli
867
867
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
868
868
  .action(async (root, options) => {
869
869
  filterDuplicateOptions(options);
870
- const { optimizeDeps } = await import('./chunks/dep-wTaJK0Jt.js').then(function (n) { return n.B; });
870
+ const { optimizeDeps } = await import('./chunks/dep-Pluk1iaB.js').then(function (n) { return n.B; });
871
871
  try {
872
872
  const config = await resolveConfig({
873
873
  root,
@@ -893,7 +893,7 @@ cli
893
893
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
894
894
  .action(async (root, options) => {
895
895
  filterDuplicateOptions(options);
896
- const { preview } = await import('./chunks/dep-wTaJK0Jt.js').then(function (n) { return n.D; });
896
+ const { preview } = await import('./chunks/dep-Pluk1iaB.js').then(function (n) { return n.D; });
897
897
  try {
898
898
  const server = await preview({
899
899
  root,
@@ -1572,6 +1572,13 @@ interface FileSystemServeOptions {
1572
1572
  * @default ['.env', '.env.*', '*.crt', '*.pem']
1573
1573
  */
1574
1574
  deny?: string[];
1575
+ /**
1576
+ * Enable caching of fs calls.
1577
+ *
1578
+ * @experimental
1579
+ * @default false
1580
+ */
1581
+ cachedChecks?: boolean;
1575
1582
  }
1576
1583
  type ServerHook = (this: void, server: ViteDevServer) => (() => void) | void | Promise<(() => void) | void>;
1577
1584
  type HttpServer = http.Server | Http2SecureServer;
@@ -2563,6 +2570,16 @@ interface DepOptimizationMetadata {
2563
2570
  * This is checked on server startup to avoid unnecessary re-bundles.
2564
2571
  */
2565
2572
  hash: string;
2573
+ /**
2574
+ * This hash is determined by dependency lockfiles.
2575
+ * This is checked on server startup to avoid unnecessary re-bundles.
2576
+ */
2577
+ lockfileHash: string;
2578
+ /**
2579
+ * This hash is determined by user config.
2580
+ * This is checked on server startup to avoid unnecessary re-bundles.
2581
+ */
2582
+ configHash: string;
2566
2583
  /**
2567
2584
  * The browser hash is determined by the main hash plus additional dependencies
2568
2585
  * discovered at runtime. This is used to invalidate browser requests to
@@ -2634,6 +2651,18 @@ interface ResolvedSSROptions extends SSROptions {
2634
2651
  optimizeDeps: SsrDepOptimizationOptions;
2635
2652
  }
2636
2653
 
2654
+ interface FsUtils {
2655
+ existsSync: (path: string) => boolean;
2656
+ isDirectory: (path: string) => boolean;
2657
+ tryResolveRealFile: (path: string, preserveSymlinks?: boolean) => string | undefined;
2658
+ tryResolveRealFileWithExtensions: (path: string, extensions: string[], preserveSymlinks?: boolean) => string | undefined;
2659
+ tryResolveRealFileOrType: (path: string, preserveSymlinks?: boolean) => {
2660
+ path?: string;
2661
+ type: 'directory' | 'file';
2662
+ } | undefined;
2663
+ initWatcher?: (watcher: FSWatcher) => void;
2664
+ }
2665
+
2637
2666
  interface ResolveOptions {
2638
2667
  /**
2639
2668
  * @default ['browser', 'module', 'jsnext:main', 'jsnext']
@@ -2656,6 +2685,7 @@ interface InternalResolveOptions extends Required<ResolveOptions> {
2656
2685
  isProduction: boolean;
2657
2686
  ssrConfig?: SSROptions;
2658
2687
  packageCache?: PackageCache;
2688
+ fsUtils?: FsUtils;
2659
2689
  /**
2660
2690
  * src code mode also attempts the following:
2661
2691
  * - resolving /xxx as URLs
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules } from './chunks/dep-wTaJK0Jt.js';
3
- export { b as build, e as buildErrorMessage, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, u as isFileServingAllowed, l as loadConfigFromFile, v as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, r as resolveConfig, w as resolveEnvPrefix, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-wTaJK0Jt.js';
2
+ import { i as isInNodeModules } from './chunks/dep-Pluk1iaB.js';
3
+ export { b as build, e as buildErrorMessage, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, u as isFileServingAllowed, l as loadConfigFromFile, v as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, r as resolveConfig, w as resolveEnvPrefix, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-Pluk1iaB.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  export { VERSION as rollupVersion } from 'rollup';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "5.0.7",
3
+ "version": "5.0.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@ampproject/remapping": "^2.2.1",
73
- "@babel/parser": "^7.23.5",
73
+ "@babel/parser": "^7.23.6",
74
74
  "@jridgewell/trace-mapping": "^0.3.20",
75
75
  "@rollup/plugin-alias": "^5.1.0",
76
76
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -82,7 +82,7 @@
82
82
  "@types/escape-html": "^1.0.4",
83
83
  "@types/pnpapi": "^0.0.5",
84
84
  "acorn": "^8.11.2",
85
- "acorn-walk": "^8.3.0",
85
+ "acorn-walk": "^8.3.1",
86
86
  "cac": "^6.7.14",
87
87
  "chokidar": "^3.5.3",
88
88
  "connect": "^3.7.0",
@@ -126,7 +126,7 @@
126
126
  "tslib": "^2.6.2",
127
127
  "types": "link:./types",
128
128
  "ufo": "^1.3.2",
129
- "ws": "^8.14.2"
129
+ "ws": "^8.15.0"
130
130
  },
131
131
  "peerDependencies": {
132
132
  "@types/node": "^18.0.0 || >=20.0.0",