vite 5.1.4 → 5.1.5

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 { B as getDefaultExportFromCjs } from './dep-jDlpJiMN.js';
1
+ import { B as getDefaultExportFromCjs } from './dep-G-px366b.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';
@@ -1,4 +1,4 @@
1
- import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-jDlpJiMN.js';
1
+ import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-G-px366b.js';
2
2
  import require$$0__default from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
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 { c as colors, a as createLogger, r as resolveConfig } from './chunks/dep-jDlpJiMN.js';
5
+ import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-G-px366b.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -757,7 +757,7 @@ cli
757
757
  filterDuplicateOptions(options);
758
758
  // output structure is preserved even after bundling so require()
759
759
  // is ok here
760
- const { createServer } = await import('./chunks/dep-jDlpJiMN.js').then(function (n) { return n.E; });
760
+ const { createServer } = await import('./chunks/dep-G-px366b.js').then(function (n) { return n.E; });
761
761
  try {
762
762
  const server = await createServer({
763
763
  root,
@@ -836,7 +836,7 @@ cli
836
836
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
837
837
  .action(async (root, options) => {
838
838
  filterDuplicateOptions(options);
839
- const { build } = await import('./chunks/dep-jDlpJiMN.js').then(function (n) { return n.F; });
839
+ const { build } = await import('./chunks/dep-G-px366b.js').then(function (n) { return n.F; });
840
840
  const buildOptions = cleanOptions(options);
841
841
  try {
842
842
  await build({
@@ -863,7 +863,7 @@ cli
863
863
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
864
864
  .action(async (root, options) => {
865
865
  filterDuplicateOptions(options);
866
- const { optimizeDeps } = await import('./chunks/dep-jDlpJiMN.js').then(function (n) { return n.D; });
866
+ const { optimizeDeps } = await import('./chunks/dep-G-px366b.js').then(function (n) { return n.D; });
867
867
  try {
868
868
  const config = await resolveConfig({
869
869
  root,
@@ -889,7 +889,7 @@ cli
889
889
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
890
890
  .action(async (root, options) => {
891
891
  filterDuplicateOptions(options);
892
- const { preview } = await import('./chunks/dep-jDlpJiMN.js').then(function (n) { return n.G; });
892
+ const { preview } = await import('./chunks/dep-G-px366b.js').then(function (n) { return n.G; });
893
893
  try {
894
894
  const server = await preview({
895
895
  root,
@@ -45,22 +45,6 @@ const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/;
45
45
  * Prefix for resolved fs paths, since windows paths may not be valid as URLs.
46
46
  */
47
47
  const FS_PREFIX = `/@fs/`;
48
- /**
49
- * Prefix for resolved Ids that are not valid browser import specifiers
50
- */
51
- const VALID_ID_PREFIX = `/@id/`;
52
- /**
53
- * Plugins that use 'virtual modules' (e.g. for helper functions), prefix the
54
- * module ID with `\0`, a convention from the rollup ecosystem.
55
- * This prevents other plugins from trying to process the id (like node resolution),
56
- * and core features like sourcemaps can use this info to differentiate between
57
- * virtual modules and regular files.
58
- * `\0` is not a permitted char in import URLs so we have to replace them during
59
- * import analysis. The id will be decoded back before entering the plugins pipeline.
60
- * These encoded virtual ids are also prefixed by the VALID_ID_PREFIX, so virtual
61
- * modules in the browser end up encoded as `/@id/__x00__{id}`
62
- */
63
- const NULL_BYTE_PLACEHOLDER = `__x00__`;
64
48
  const CLIENT_PUBLIC_PATH = `/@vite/client`;
65
49
  const ENV_PUBLIC_PATH = `/@vite/env`;
66
50
  const VITE_PACKAGE_DIR = resolve(
@@ -128,4 +112,4 @@ const DEFAULT_PREVIEW_PORT = 4173;
128
112
  const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
129
113
  const METADATA_FILENAME = '_metadata.json';
130
114
 
131
- export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEFAULT_PREVIEW_PORT, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
115
+ export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEFAULT_PREVIEW_PORT, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
@@ -15,8 +15,8 @@ import * as url from 'node:url';
15
15
  import { URL } from 'node:url';
16
16
  import * as stream from 'node:stream';
17
17
  import { Duplex, DuplexOptions } from 'node:stream';
18
- import { F as FetchResult, V as ViteRuntimeOptions, H as HMRLogger, a as ViteModuleRunner, b as ViteRuntime, c as HMRRuntimeConnection } from './types.d-jgA8ss1A.js';
19
- export { d as FetchFunction } from './types.d-jgA8ss1A.js';
18
+ import { F as FetchResult, H as HMRLogger } from './types.d-AKzkD8vd.js';
19
+ export { a as FetchFunction } from './types.d-AKzkD8vd.js';
20
20
  import { SecureContextOptions } from 'node:tls';
21
21
  import { ZlibOptions } from 'node:zlib';
22
22
  import { HMRPayload, CustomPayload } from '../../types/hmrPayload.js';
@@ -26,6 +26,7 @@ export { CustomEventMap, InferCustomEventPayload, InvalidatePayload } from '../.
26
26
  import { TransformOptions as esbuild_TransformOptions, TransformResult as esbuild_TransformResult, BuildOptions as esbuild_BuildOptions } from 'esbuild';
27
27
  export { TransformOptions as EsbuildTransformOptions, version as esbuildVersion } from 'esbuild';
28
28
  import * as PostCSS from 'postcss';
29
+ import { ViteRuntimeOptions, ViteModuleRunner, ViteRuntime, HMRRuntimeConnection } from 'vite/runtime';
29
30
  export { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap } from '../../types/importGlob.js';
30
31
  export { ChunkMetadata } from '../../types/metadata.js';
31
32
  import '../../types/hot.js';
@@ -1,10 +1,10 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, b as arraify } from './chunks/dep-jDlpJiMN.js';
3
- export { f as build, j as buildErrorMessage, u as createFilter, a as createLogger, e as createServer, d as defineConfig, k as fetchModule, g as formatPostcssSourceMap, y as isFileServingAllowed, l as loadConfigFromFile, z as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, A as resolveEnvPrefix, v as rollupVersion, x as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-jDlpJiMN.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-G-px366b.js';
3
+ export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-G-px366b.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import { existsSync, readFileSync } from 'node:fs';
7
- import { ViteRuntime, ESModulesRunner } from './runtime.js';
7
+ import { ViteRuntime, ESModulesRunner } from 'vite/runtime';
8
8
  import 'node:fs/promises';
9
9
  import 'node:path';
10
10
  import 'node:url';
@@ -1,12 +1,63 @@
1
- import { a as ViteModuleRunner, e as ViteRuntimeModuleContext } from './types.d-jgA8ss1A.js';
2
- export { d as FetchFunction, F as FetchResult, f as HMRConnection, H as HMRLogger, c as HMRRuntimeConnection, g as ModuleCache, M as ModuleCacheMap, R as ResolvedResult, S as SSRImportMetadata, b as ViteRuntime, h as ViteRuntimeImportMeta, V as ViteRuntimeOptions, s as ssrDynamicImportKey, i as ssrExportAllKey, j as ssrImportKey, k as ssrImportMetaKey, l as ssrModuleExportsKey } from './types.d-jgA8ss1A.js';
1
+ import { V as ViteRuntimeOptions, b as ViteModuleRunner, M as ModuleCacheMap, c as HMRClient, R as ResolvedResult, d as ViteRuntimeModuleContext } from './types.d-AKzkD8vd.js';
2
+ export { a as FetchFunction, F as FetchResult, e as HMRConnection, H as HMRLogger, g as HMRRuntimeConnection, f as ModuleCache, S as SSRImportMetadata, h as ViteRuntimeImportMeta, s as ssrDynamicImportKey, i as ssrExportAllKey, j as ssrImportKey, k as ssrImportMetaKey, l as ssrModuleExportsKey } from './types.d-AKzkD8vd.js';
3
3
  import '../../types/hot.js';
4
4
  import '../../types/hmrPayload.js';
5
5
  import '../../types/customEvent.js';
6
6
 
7
+ interface ViteRuntimeDebugger {
8
+ (formatter: unknown, ...args: unknown[]): void;
9
+ }
10
+ declare class ViteRuntime {
11
+ options: ViteRuntimeOptions;
12
+ runner: ViteModuleRunner;
13
+ private debug?;
14
+ /**
15
+ * Holds the cache of modules
16
+ * Keys of the map are ids
17
+ */
18
+ moduleCache: ModuleCacheMap;
19
+ hmrClient?: HMRClient;
20
+ entrypoints: Set<string>;
21
+ private idToUrlMap;
22
+ private fileToIdMap;
23
+ private envProxy;
24
+ private _destroyed;
25
+ private _resetSourceMapSupport?;
26
+ constructor(options: ViteRuntimeOptions, runner: ViteModuleRunner, debug?: ViteRuntimeDebugger | undefined);
27
+ /**
28
+ * URL to execute. Accepts file path, server path or id relative to the root.
29
+ */
30
+ executeUrl<T = any>(url: string): Promise<T>;
31
+ /**
32
+ * Entrypoint URL to execute. Accepts file path, server path or id relative to the root.
33
+ * In the case of a full reload triggered by HMR, this is the module that will be reloaded.
34
+ * If this method is called multiple times, all entrypoints will be reloaded one at a time.
35
+ */
36
+ executeEntrypoint<T = any>(url: string): Promise<T>;
37
+ /**
38
+ * Clear all caches including HMR listeners.
39
+ */
40
+ clearCache(): void;
41
+ /**
42
+ * Clears all caches, removes all HMR listeners, and resets source map support.
43
+ * This method doesn't stop the HMR connection.
44
+ */
45
+ destroy(): Promise<void>;
46
+ /**
47
+ * Returns `true` if the runtime has been destroyed by calling `destroy()` method.
48
+ */
49
+ isDestroyed(): boolean;
50
+ private invalidateFiles;
51
+ private normalizeEntryUrl;
52
+ private processImport;
53
+ private cachedRequest;
54
+ private cachedModule;
55
+ protected directRequest(id: string, fetchResult: ResolvedResult, _callstack: string[]): Promise<any>;
56
+ }
57
+
7
58
  declare class ESModulesRunner implements ViteModuleRunner {
8
59
  runViteModule(context: ViteRuntimeModuleContext, code: string): Promise<any>;
9
60
  runExternalModule(filepath: string): Promise<any>;
10
61
  }
11
62
 
12
- export { ESModulesRunner, ViteModuleRunner, ViteRuntimeModuleContext };
63
+ export { ESModulesRunner, ModuleCacheMap, ResolvedResult, ViteModuleRunner, ViteRuntime, ViteRuntimeModuleContext, ViteRuntimeOptions };