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.
- package/dist/node/chunks/{dep-jDlpJiMN.js → dep-G-px366b.js} +250 -220
- package/dist/node/chunks/{dep-wALyWXZB.js → dep-OHeF5w5D.js} +1 -1
- package/dist/node/chunks/{dep-g6LmopN4.js → dep-WMYkPWs9.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/constants.js +1 -17
- package/dist/node/index.d.ts +3 -2
- package/dist/node/index.js +3 -3
- package/dist/node/runtime.d.ts +54 -3
- package/dist/node/runtime.js +928 -1524
- package/dist/node/{types.d-jgA8ss1A.d.ts → types.d-AKzkD8vd.d.ts} +6 -52
- package/dist/node-cjs/publicUtils.cjs +44 -60
- package/package.json +7 -5
- package/types/hmrPayload.d.ts +2 -0
@@ -96,6 +96,11 @@ declare class ModuleCacheMap extends Map<string, ModuleCache> {
|
|
96
96
|
get(fsPath: string): ModuleCache;
|
97
97
|
deleteByModuleId(modulePath: string): boolean;
|
98
98
|
delete(fsPath: string): boolean;
|
99
|
+
invalidate(id: string): void;
|
100
|
+
isImported({ importedId, importedBy, }: {
|
101
|
+
importedId: string;
|
102
|
+
importedBy: string;
|
103
|
+
}, seen?: Set<string>): boolean;
|
99
104
|
/**
|
100
105
|
* Invalidate modules that dependent on the given modules, up to the main entry
|
101
106
|
*/
|
@@ -113,57 +118,6 @@ declare const ssrDynamicImportKey = "__vite_ssr_dynamic_import__";
|
|
113
118
|
declare const ssrExportAllKey = "__vite_ssr_exportAll__";
|
114
119
|
declare const ssrImportMetaKey = "__vite_ssr_import_meta__";
|
115
120
|
|
116
|
-
interface ViteRuntimeDebugger {
|
117
|
-
(formatter: unknown, ...args: unknown[]): void;
|
118
|
-
}
|
119
|
-
declare class ViteRuntime {
|
120
|
-
options: ViteRuntimeOptions;
|
121
|
-
runner: ViteModuleRunner;
|
122
|
-
private debug?;
|
123
|
-
/**
|
124
|
-
* Holds the cache of modules
|
125
|
-
* Keys of the map are ids
|
126
|
-
*/
|
127
|
-
moduleCache: ModuleCacheMap;
|
128
|
-
hmrClient?: HMRClient;
|
129
|
-
entrypoints: Set<string>;
|
130
|
-
private idToUrlMap;
|
131
|
-
private fileToIdMap;
|
132
|
-
private envProxy;
|
133
|
-
private _destroyed;
|
134
|
-
private _resetSourceMapSupport?;
|
135
|
-
constructor(options: ViteRuntimeOptions, runner: ViteModuleRunner, debug?: ViteRuntimeDebugger | undefined);
|
136
|
-
/**
|
137
|
-
* URL to execute. Accepts file path, server path or id relative to the root.
|
138
|
-
*/
|
139
|
-
executeUrl<T = any>(url: string): Promise<T>;
|
140
|
-
/**
|
141
|
-
* Entrypoint URL to execute. Accepts file path, server path or id relative to the root.
|
142
|
-
* In the case of a full reload triggered by HMR, this is the module that will be reloaded.
|
143
|
-
* If this method is called multiple times, all entrypoints will be reloaded one at a time.
|
144
|
-
*/
|
145
|
-
executeEntrypoint<T = any>(url: string): Promise<T>;
|
146
|
-
/**
|
147
|
-
* Clear all caches including HMR listeners.
|
148
|
-
*/
|
149
|
-
clearCache(): void;
|
150
|
-
/**
|
151
|
-
* Clears all caches, removes all HMR listeners, and resets source map support.
|
152
|
-
* This method doesn't stop the HMR connection.
|
153
|
-
*/
|
154
|
-
destroy(): Promise<void>;
|
155
|
-
/**
|
156
|
-
* Returns `true` if the runtime has been destroyed by calling `destroy()` method.
|
157
|
-
*/
|
158
|
-
isDestroyed(): boolean;
|
159
|
-
private invalidateFiles;
|
160
|
-
private normalizeEntryUrl;
|
161
|
-
private processImport;
|
162
|
-
private cachedRequest;
|
163
|
-
private cachedModule;
|
164
|
-
protected directRequest(id: string, fetchResult: ResolvedResult, _callstack: string[]): Promise<any>;
|
165
|
-
}
|
166
|
-
|
167
121
|
interface RetrieveFileHandler {
|
168
122
|
(path: string): string | null | undefined | false;
|
169
123
|
}
|
@@ -321,4 +275,4 @@ interface ImportMetaEnv {
|
|
321
275
|
SSR: boolean;
|
322
276
|
}
|
323
277
|
|
324
|
-
export { type FetchResult as F, type HMRLogger as H, ModuleCacheMap as M, type ResolvedResult as R, type SSRImportMetadata as S, type ViteRuntimeOptions as V, type
|
278
|
+
export { type FetchResult as F, type HMRLogger as H, ModuleCacheMap as M, type ResolvedResult as R, type SSRImportMetadata as S, type ViteRuntimeOptions as V, type FetchFunction as a, type ViteModuleRunner as b, HMRClient as c, type ViteRuntimeModuleContext as d, type HMRConnection as e, type ModuleCache as f, type HMRRuntimeConnection as g, type ViteRuntimeImportMeta as h, ssrExportAllKey as i, ssrImportKey as j, ssrImportMetaKey as k, ssrModuleExportsKey as l, ssrDynamicImportKey as s };
|
@@ -4,7 +4,6 @@ var path$3 = require('node:path');
|
|
4
4
|
var node_url = require('node:url');
|
5
5
|
var fs$1 = require('node:fs');
|
6
6
|
var esbuild = require('esbuild');
|
7
|
-
var os$1 = require('node:os');
|
8
7
|
var node_module = require('node:module');
|
9
8
|
var require$$0 = require('tty');
|
10
9
|
var require$$1 = require('util');
|
@@ -116,18 +115,6 @@ function encodeInteger(buf, pos, state, segment, j) {
|
|
116
115
|
return pos;
|
117
116
|
}
|
118
117
|
|
119
|
-
// Matches the scheme of a URL, eg "http://"
|
120
|
-
var UrlType;
|
121
|
-
(function (UrlType) {
|
122
|
-
UrlType[UrlType["Empty"] = 1] = "Empty";
|
123
|
-
UrlType[UrlType["Hash"] = 2] = "Hash";
|
124
|
-
UrlType[UrlType["Query"] = 3] = "Query";
|
125
|
-
UrlType[UrlType["RelativePath"] = 4] = "RelativePath";
|
126
|
-
UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath";
|
127
|
-
UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative";
|
128
|
-
UrlType[UrlType["Absolute"] = 7] = "Absolute";
|
129
|
-
})(UrlType || (UrlType = {}));
|
130
|
-
|
131
118
|
function getDefaultExportFromCjs (x) {
|
132
119
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
133
120
|
}
|
@@ -3355,6 +3342,22 @@ const builtins = 'arguments Infinity NaN undefined null true false eval uneval i
|
|
3355
3342
|
const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));
|
3356
3343
|
forbiddenIdentifiers.add('');
|
3357
3344
|
|
3345
|
+
const isWindows = typeof process !== 'undefined' && process.platform === 'win32';
|
3346
|
+
const windowsSlashRE = /\\/g;
|
3347
|
+
function slash(p) {
|
3348
|
+
return p.replace(windowsSlashRE, '/');
|
3349
|
+
}
|
3350
|
+
const postfixRE = /[?#].*$/;
|
3351
|
+
function cleanUrl(url) {
|
3352
|
+
return url.replace(postfixRE, '');
|
3353
|
+
}
|
3354
|
+
function withTrailingSlash(path) {
|
3355
|
+
if (path[path.length - 1] !== '/') {
|
3356
|
+
return `${path}/`;
|
3357
|
+
}
|
3358
|
+
return path;
|
3359
|
+
}
|
3360
|
+
|
3358
3361
|
if (process.versions.pnp) {
|
3359
3362
|
try {
|
3360
3363
|
node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))('pnpapi');
|
@@ -3363,10 +3366,6 @@ if (process.versions.pnp) {
|
|
3363
3366
|
}
|
3364
3367
|
|
3365
3368
|
const createFilter = createFilter$1;
|
3366
|
-
const windowsSlashRE = /\\/g;
|
3367
|
-
function slash(p) {
|
3368
|
-
return p.replace(windowsSlashRE, '/');
|
3369
|
-
}
|
3370
3369
|
// Some runtimes like Bun injects namespaced modules here, which is not a node builtin
|
3371
3370
|
node_module.builtinModules.filter((id) => !id.includes(':'));
|
3372
3371
|
function isInNodeModules(id) {
|
@@ -3409,7 +3408,6 @@ function testCaseInsensitiveFS() {
|
|
3409
3408
|
return fs$1.existsSync(CLIENT_ENTRY.replace('client.mjs', 'cLiEnT.mjs'));
|
3410
3409
|
}
|
3411
3410
|
const isCaseInsensitiveFS = testCaseInsensitiveFS();
|
3412
|
-
const isWindows = os$1.platform() === 'win32';
|
3413
3411
|
const VOLUME_RE = /^[A-Z]:/i;
|
3414
3412
|
function normalizePath(id) {
|
3415
3413
|
return path$3.posix.normalize(isWindows ? slash(id) : id);
|
@@ -3421,12 +3419,6 @@ function fsPathFromId(id) {
|
|
3421
3419
|
function fsPathFromUrl(url) {
|
3422
3420
|
return fsPathFromId(cleanUrl(url));
|
3423
3421
|
}
|
3424
|
-
function withTrailingSlash(path) {
|
3425
|
-
if (path[path.length - 1] !== '/') {
|
3426
|
-
return `${path}/`;
|
3427
|
-
}
|
3428
|
-
return path;
|
3429
|
-
}
|
3430
3422
|
/**
|
3431
3423
|
* Check if dir is a parent of file
|
3432
3424
|
*
|
@@ -3454,10 +3446,6 @@ function isSameFileUri(file1, file2) {
|
|
3454
3446
|
return (file1 === file2 ||
|
3455
3447
|
(isCaseInsensitiveFS && file1.toLowerCase() === file2.toLowerCase()));
|
3456
3448
|
}
|
3457
|
-
const postfixRE = /[?#].*$/;
|
3458
|
-
function cleanUrl(url) {
|
3459
|
-
return url.replace(postfixRE, '');
|
3460
|
-
}
|
3461
3449
|
const trailingSeparatorRE = /[?&]$/;
|
3462
3450
|
const timestampRE = /\bt=\d{13}&?\b/;
|
3463
3451
|
function removeTimestampQuery(url) {
|
@@ -5577,7 +5565,7 @@ function isFileServingAllowed(url, server) {
|
|
5577
5565
|
var main$1 = {exports: {}};
|
5578
5566
|
|
5579
5567
|
var name = "dotenv";
|
5580
|
-
var version$1 = "16.4.
|
5568
|
+
var version$1 = "16.4.5";
|
5581
5569
|
var description = "Loads environment variables from .env file";
|
5582
5570
|
var main = "lib/main.js";
|
5583
5571
|
var types = "lib/main.d.ts";
|
@@ -5874,52 +5862,48 @@ function configDotenv (options) {
|
|
5874
5862
|
}
|
5875
5863
|
}
|
5876
5864
|
|
5877
|
-
let
|
5865
|
+
let optionPaths = [dotenvPath]; // default, look for .env
|
5878
5866
|
if (options && options.path) {
|
5879
5867
|
if (!Array.isArray(options.path)) {
|
5880
|
-
|
5881
|
-
optionPathsThatExist = [_resolveHome(options.path)];
|
5882
|
-
}
|
5868
|
+
optionPaths = [_resolveHome(options.path)];
|
5883
5869
|
} else {
|
5870
|
+
optionPaths = []; // reset default
|
5884
5871
|
for (const filepath of options.path) {
|
5885
|
-
|
5886
|
-
optionPathsThatExist.push(_resolveHome(filepath));
|
5887
|
-
}
|
5872
|
+
optionPaths.push(_resolveHome(filepath));
|
5888
5873
|
}
|
5889
5874
|
}
|
5890
|
-
|
5891
|
-
if (!optionPathsThatExist.length) {
|
5892
|
-
optionPathsThatExist = [dotenvPath];
|
5893
|
-
}
|
5894
5875
|
}
|
5895
5876
|
|
5896
|
-
// If we have options.path, and it had valid paths, use them. Else fall back to .env
|
5897
|
-
const pathsToProcess = optionPathsThatExist.length ? optionPathsThatExist : [dotenvPath];
|
5898
|
-
|
5899
5877
|
// Build the parsed data in a temporary object (because we need to return it). Once we have the final
|
5900
5878
|
// parsed data, we will combine it with process.env (or options.processEnv if provided).
|
5901
|
-
|
5902
|
-
const
|
5903
|
-
|
5904
|
-
|
5879
|
+
let lastError;
|
5880
|
+
const parsedAll = {};
|
5881
|
+
for (const path of optionPaths) {
|
5882
|
+
try {
|
5905
5883
|
// Specifying an encoding returns a string instead of a buffer
|
5906
|
-
const
|
5907
|
-
DotenvModule.populate(parsed, singleFileParsed, options);
|
5908
|
-
}
|
5884
|
+
const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }));
|
5909
5885
|
|
5910
|
-
|
5911
|
-
|
5912
|
-
|
5886
|
+
DotenvModule.populate(parsedAll, parsed, options);
|
5887
|
+
} catch (e) {
|
5888
|
+
if (debug) {
|
5889
|
+
_debug(`Failed to load ${path} ${e.message}`);
|
5890
|
+
}
|
5891
|
+
lastError = e;
|
5913
5892
|
}
|
5893
|
+
}
|
5914
5894
|
|
5915
|
-
|
5916
|
-
|
5917
|
-
|
5918
|
-
|
5919
|
-
|
5920
|
-
|
5895
|
+
let processEnv = process.env;
|
5896
|
+
if (options && options.processEnv != null) {
|
5897
|
+
processEnv = options.processEnv;
|
5898
|
+
}
|
5899
|
+
|
5900
|
+
DotenvModule.populate(processEnv, parsedAll, options);
|
5901
|
+
|
5902
|
+
if (lastError) {
|
5903
|
+
return { parsed: parsedAll, error: lastError }
|
5904
|
+
} else {
|
5905
|
+
return { parsed: parsedAll }
|
5921
5906
|
}
|
5922
|
-
return { parsed }
|
5923
5907
|
}
|
5924
5908
|
|
5925
5909
|
// Populates process.env from .env file
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "5.1.
|
3
|
+
"version": "5.1.5",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -82,7 +82,7 @@
|
|
82
82
|
"devDependencies": {
|
83
83
|
"@ampproject/remapping": "^2.2.1",
|
84
84
|
"@babel/parser": "^7.23.9",
|
85
|
-
"@jridgewell/trace-mapping": "^0.3.
|
85
|
+
"@jridgewell/trace-mapping": "^0.3.23",
|
86
86
|
"@rollup/plugin-alias": "^5.1.0",
|
87
87
|
"@rollup/plugin-commonjs": "^25.0.7",
|
88
88
|
"@rollup/plugin-dynamic-import-vars": "^2.1.2",
|
@@ -103,7 +103,7 @@
|
|
103
103
|
"cross-spawn": "^7.0.3",
|
104
104
|
"debug": "^4.3.4",
|
105
105
|
"dep-types": "link:./src/types",
|
106
|
-
"dotenv": "^16.4.
|
106
|
+
"dotenv": "^16.4.5",
|
107
107
|
"dotenv-expand": "^11.0.6",
|
108
108
|
"es-module-lexer": "^1.4.1",
|
109
109
|
"escape-html": "^1.0.3",
|
@@ -112,13 +112,14 @@
|
|
112
112
|
"fast-glob": "^3.3.2",
|
113
113
|
"http-proxy": "^1.18.1",
|
114
114
|
"launch-editor-middleware": "^2.6.1",
|
115
|
-
"lightningcss": "^1.
|
115
|
+
"lightningcss": "^1.24.0",
|
116
116
|
"magic-string": "^0.30.7",
|
117
117
|
"micromatch": "^4.0.5",
|
118
|
-
"mlly": "^1.
|
118
|
+
"mlly": "^1.6.1",
|
119
119
|
"mrmime": "^2.0.0",
|
120
120
|
"open": "^8.4.2",
|
121
121
|
"parse5": "^7.1.2",
|
122
|
+
"pathe": "^1.1.2",
|
122
123
|
"periscopic": "^4.0.2",
|
123
124
|
"picocolors": "^1.0.0",
|
124
125
|
"picomatch": "^2.3.1",
|
@@ -127,6 +128,7 @@
|
|
127
128
|
"postcss-modules": "^6.0.0",
|
128
129
|
"resolve.exports": "^2.0.2",
|
129
130
|
"rollup-plugin-dts": "^6.1.0",
|
131
|
+
"rollup-plugin-esbuild": "^6.1.1",
|
130
132
|
"rollup-plugin-license": "^3.2.0",
|
131
133
|
"sirv": "^2.0.4",
|
132
134
|
"source-map-support": "^0.5.21",
|