vite 4.2.0-beta.0 → 4.2.0-beta.2
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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/dist/node/chunks/{dep-51508e52.js → dep-80b98891.js} +1 -1
- package/dist/node/chunks/{dep-ae3bb4e1.js → dep-84d7cc5e.js} +839 -516
- package/dist/node/cli.js +6 -5
- package/dist/node/index.d.ts +22 -0
- package/dist/node/index.js +2 -1
- package/dist/node-cjs/publicUtils.cjs +3 -3
- package/package.json +6 -6
|
@@ -4,7 +4,7 @@ import { URL as URL$3, URLSearchParams, parse as parse$i, pathToFileURL } from '
|
|
|
4
4
|
import { performance } from 'node:perf_hooks';
|
|
5
5
|
import { createRequire as createRequire$1, builtinModules } from 'node:module';
|
|
6
6
|
import require$$0$3 from 'tty';
|
|
7
|
-
import { transform as transform$2, formatMessages, build as build$3 } from 'esbuild';
|
|
7
|
+
import esbuild, { transform as transform$2, formatMessages, build as build$3 } from 'esbuild';
|
|
8
8
|
import require$$0$4, { win32, posix, isAbsolute as isAbsolute$1, resolve as resolve$3, relative as relative$1, basename as basename$1, extname, dirname as dirname$1, join as join$1, sep, normalize } from 'path';
|
|
9
9
|
import * as require$$0$2 from 'fs';
|
|
10
10
|
import require$$0__default, { existsSync, readFileSync, statSync as statSync$1, promises as promises$1, readdirSync } from 'fs';
|
|
@@ -22,9 +22,10 @@ import { createHash as createHash$2 } from 'node:crypto';
|
|
|
22
22
|
import { promisify as promisify$4, format as format$2, inspect } from 'node:util';
|
|
23
23
|
import { promises } from 'node:dns';
|
|
24
24
|
import resolve$4 from 'resolve';
|
|
25
|
-
import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, DEFAULT_EXTENSIONS as DEFAULT_EXTENSIONS$1, wildcardHosts, loopbackHosts, VALID_ID_PREFIX, NULL_BYTE_PLACEHOLDER, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, ENV_ENTRY, DEFAULT_MAIN_FIELDS, SPECIAL_QUERY_RE, DEP_VERSION_RE,
|
|
25
|
+
import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, DEFAULT_EXTENSIONS as DEFAULT_EXTENSIONS$1, wildcardHosts, loopbackHosts, VALID_ID_PREFIX, NULL_BYTE_PLACEHOLDER, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, ENV_ENTRY, DEFAULT_MAIN_FIELDS, SPECIAL_QUERY_RE, DEP_VERSION_RE, CSS_LANGS_RE, KNOWN_ASSET_TYPES, CLIENT_DIR, JS_TYPES_RE, ESBUILD_MODULES_TARGET, VERSION as VERSION$1, VITE_PACKAGE_DIR, DEFAULT_DEV_PORT, DEFAULT_PREVIEW_PORT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES } from '../constants.js';
|
|
26
26
|
import require$$5$1 from 'crypto';
|
|
27
27
|
import { Buffer as Buffer$1 } from 'node:buffer';
|
|
28
|
+
import fsp from 'node:fs/promises';
|
|
28
29
|
import require$$0$8, { createRequire as createRequire$2 } from 'module';
|
|
29
30
|
import assert$1 from 'node:assert';
|
|
30
31
|
import process$1 from 'node:process';
|
|
@@ -12123,6 +12124,13 @@ async function getLocalhostAddressIfDiffersFromDNS() {
|
|
|
12123
12124
|
nodeResult.address === dnsResult.address;
|
|
12124
12125
|
return isSame ? undefined : nodeResult.address;
|
|
12125
12126
|
}
|
|
12127
|
+
function diffDnsOrderChange(oldUrls, newUrls) {
|
|
12128
|
+
return !(oldUrls === newUrls ||
|
|
12129
|
+
(oldUrls &&
|
|
12130
|
+
newUrls &&
|
|
12131
|
+
arrayEqual(oldUrls.local, newUrls.local) &&
|
|
12132
|
+
arrayEqual(oldUrls.network, newUrls.network)));
|
|
12133
|
+
}
|
|
12126
12134
|
async function resolveHostname(optionsHost) {
|
|
12127
12135
|
let host;
|
|
12128
12136
|
if (optionsHost === undefined || optionsHost === false) {
|
|
@@ -12172,9 +12180,9 @@ async function resolveServerUrls(server, options, config) {
|
|
|
12172
12180
|
.flatMap((nInterface) => nInterface ?? [])
|
|
12173
12181
|
.filter((detail) => detail &&
|
|
12174
12182
|
detail.address &&
|
|
12175
|
-
(
|
|
12183
|
+
(detail.family === 'IPv4' ||
|
|
12176
12184
|
// @ts-expect-error Node 18.0 - 18.3 returns number
|
|
12177
|
-
|
|
12185
|
+
detail.family === 4))
|
|
12178
12186
|
.forEach((detail) => {
|
|
12179
12187
|
let host = detail.address.replace('127.0.0.1', hostname.name);
|
|
12180
12188
|
// ipv6 host
|
|
@@ -12732,7 +12740,7 @@ function buildReporterPlugin(config) {
|
|
|
12732
12740
|
const mapPad = displaySize(biggestMap).length;
|
|
12733
12741
|
const compressPad = displaySize(biggestCompressSize).length;
|
|
12734
12742
|
const relativeOutDir = normalizePath$3(path$o.relative(config.root, path$o.resolve(config.root, outDir ?? config.build.outDir)));
|
|
12735
|
-
const assetsDir =
|
|
12743
|
+
const assetsDir = path$o.join(config.build.assetsDir, '/');
|
|
12736
12744
|
for (const group of groups) {
|
|
12737
12745
|
const filtered = entries.filter((e) => e.group === group.name);
|
|
12738
12746
|
if (!filtered.length)
|
|
@@ -12743,12 +12751,13 @@ function buildReporterPlugin(config) {
|
|
|
12743
12751
|
hasLargeChunks = true;
|
|
12744
12752
|
const sizeColor = isLarge ? picocolorsExports.yellow : picocolorsExports.dim;
|
|
12745
12753
|
let log = picocolorsExports.dim(relativeOutDir + '/');
|
|
12746
|
-
log +=
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
.
|
|
12750
|
-
|
|
12751
|
-
|
|
12754
|
+
log +=
|
|
12755
|
+
!config.build.lib && entry.name.startsWith(assetsDir)
|
|
12756
|
+
? picocolorsExports.dim(assetsDir) +
|
|
12757
|
+
group.color(entry.name
|
|
12758
|
+
.slice(assetsDir.length)
|
|
12759
|
+
.padEnd(longest + 2 - assetsDir.length))
|
|
12760
|
+
: group.color(entry.name.padEnd(longest + 2));
|
|
12752
12761
|
log += picocolorsExports.bold(sizeColor(displaySize(entry.size).padStart(sizePad)));
|
|
12753
12762
|
if (entry.compressedSize) {
|
|
12754
12763
|
log += picocolorsExports.dim(` │ gzip: ${displaySize(entry.compressedSize).padStart(compressPad)}`);
|
|
@@ -13230,18 +13239,41 @@ async function parseExtends(result, cache) {
|
|
|
13230
13239
|
const extended = [
|
|
13231
13240
|
{ tsconfigFile: result.tsconfigFile, tsconfig: JSON.parse(JSON.stringify(result.tsconfig)) }
|
|
13232
13241
|
];
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
+
let pos = 0;
|
|
13243
|
+
const extendsPath = [];
|
|
13244
|
+
let currentBranchDepth = 0;
|
|
13245
|
+
while (pos < extended.length) {
|
|
13246
|
+
const extending = extended[pos];
|
|
13247
|
+
extendsPath.push(extending.tsconfigFile);
|
|
13248
|
+
if (extending.tsconfig.extends) {
|
|
13249
|
+
currentBranchDepth += 1;
|
|
13250
|
+
let resolvedExtends;
|
|
13251
|
+
if (!Array.isArray(extending.tsconfig.extends)) {
|
|
13252
|
+
resolvedExtends = [resolveExtends(extending.tsconfig.extends, extending.tsconfigFile)];
|
|
13253
|
+
} else {
|
|
13254
|
+
resolvedExtends = extending.tsconfig.extends.reverse().map((ex) => resolveExtends(ex, extending.tsconfigFile));
|
|
13255
|
+
}
|
|
13256
|
+
const circularExtends = resolvedExtends.find(
|
|
13257
|
+
(tsconfigFile) => extendsPath.includes(tsconfigFile)
|
|
13258
|
+
);
|
|
13259
|
+
if (circularExtends) {
|
|
13260
|
+
const circle = extendsPath.concat([circularExtends]).join(" -> ");
|
|
13261
|
+
throw new TSConfckParseError(
|
|
13262
|
+
`Circular dependency in "extends": ${circle}`,
|
|
13263
|
+
"EXTENDS_CIRCULAR",
|
|
13264
|
+
result.tsconfigFile
|
|
13265
|
+
);
|
|
13266
|
+
}
|
|
13267
|
+
extended.splice(
|
|
13268
|
+
pos + 1,
|
|
13269
|
+
0,
|
|
13270
|
+
...await Promise.all(resolvedExtends.map((file) => parseFile$1(file, cache)))
|
|
13242
13271
|
);
|
|
13272
|
+
} else {
|
|
13273
|
+
extendsPath.splice(-currentBranchDepth);
|
|
13274
|
+
currentBranchDepth = 0;
|
|
13243
13275
|
}
|
|
13244
|
-
|
|
13276
|
+
pos = pos + 1;
|
|
13245
13277
|
}
|
|
13246
13278
|
result.extended = extended;
|
|
13247
13279
|
for (const ext of result.extended.slice(1)) {
|
|
@@ -13318,9 +13350,11 @@ function extendTSConfig(extending, extended) {
|
|
|
13318
13350
|
}
|
|
13319
13351
|
}
|
|
13320
13352
|
var REBASE_KEYS = [
|
|
13353
|
+
// root
|
|
13321
13354
|
"files",
|
|
13322
13355
|
"include",
|
|
13323
13356
|
"exclude",
|
|
13357
|
+
// compilerOptions
|
|
13324
13358
|
"baseUrl",
|
|
13325
13359
|
"rootDir",
|
|
13326
13360
|
"rootDirs",
|
|
@@ -13328,6 +13362,7 @@ var REBASE_KEYS = [
|
|
|
13328
13362
|
"outDir",
|
|
13329
13363
|
"outFile",
|
|
13330
13364
|
"declarationDir",
|
|
13365
|
+
// watchOptions
|
|
13331
13366
|
"excludeDirectories",
|
|
13332
13367
|
"excludeFiles"
|
|
13333
13368
|
];
|
|
@@ -13495,7 +13530,7 @@ async function transformWithEsbuild(code, filename, options, inMap) {
|
|
|
13495
13530
|
throw e;
|
|
13496
13531
|
}
|
|
13497
13532
|
}
|
|
13498
|
-
function esbuildPlugin(options
|
|
13533
|
+
function esbuildPlugin(options) {
|
|
13499
13534
|
const filter = createFilter(options.include || /\.(m?ts|[jt]sx)$/, options.exclude || /\.js$/);
|
|
13500
13535
|
// Remove optimization options for dev as we only need to transpile them,
|
|
13501
13536
|
// and for build as the final optimization is in `buildEsbuildPlugin`
|
|
@@ -15978,8 +16013,8 @@ function dataURIPlugin() {
|
|
|
15978
16013
|
};
|
|
15979
16014
|
}
|
|
15980
16015
|
|
|
15981
|
-
/* es-module-lexer 1.
|
|
15982
|
-
const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,K=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;K>0&&C.memory.grow(Math.ceil(K/65536));const k=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,k,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),K=C.se();let k;C.ip()&&(k=w(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),o.push({n:k,s:A,e:Q,ss:I,se:K,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),K=I[0],k=B<0?void 0:E.slice(B,g),o=k?k[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===K||"'"===K?w(I):I,ln:'"'===o||"'"===o?w(k):k});}function w(A){try{return (0, eval)(A)}catch(A){}}return [o,D,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMtLAABAQICAgICAgICAgICAgICAgIAAwMDBAQAAAADAAAAAAMDBQYAAAcABgIFBAUBcAEBAQUDAQABBg8CfwFBsPIAC38AQbDyAAsHcBMGbWVtb3J5AgACc2EAAAFlAAMCaXMABAJpZQAFAnNzAAYCc2UABwJhaQAIAmlkAA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EQJiEDQQAoAqQKIQILAkAgAiAFRg0AIAUgBEEAIAAgACABRiICG0EAIAEgAhsQAgsgAwtyAQR/QQAoAqQKIQBBACgCqAohAQJAAkADQCAAQQJqIQIgACABTw0BAkACQCACLwEAIgNBpH9qDgIBBAALIAIhACADQXZqDgQCAQECAQsgAEEEaiEADAALC0EAIAI2AqQKECJBAA8LQQAgAjYCpApB3QALSQEDf0EAIQMCQCACRQ0AAkADQCAALQAAIgQgAS0AACIFRw0BIAFBAWohASAAQQFqIQAgAkF/aiICDQAMAgsLIAQgBWshAwsgAwsL5AECAEGACAvGAQAAeABwAG8AcgB0AG0AcABvAHIAdABlAHQAYQBmAHIAbwBtAHUAbgBjAHQAaQBvAG4AcwBzAGUAcgB0AHYAbwB5AGkAZQBkAGUAbABlAGMAbwBuAHQAaQBuAGkAbgBzAHQAYQBuAHQAeQBiAHIAZQBhAHIAZQB0AHUAcgBkAGUAYgB1AGcAZwBlAGEAdwBhAGkAdABoAHIAdwBoAGkAbABlAGYAbwByAGkAZgBjAGEAdABjAGYAaQBuAGEAbABsAGUAbABzAABByAkLEAEAAAACAAAAAAQAADA5AAA=","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
|
|
16016
|
+
/* es-module-lexer 1.2.0 */
|
|
16017
|
+
const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const D=[],k=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let K;C.ip()&&(K=J(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),D.push({n:K,s:A,e:Q,ss:I,se:o,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),o=I[0],K=B<0?void 0:E.slice(B,g),D=K?K[0]:"";k.push({s:A,e:Q,ls:B,le:g,n:'"'===o||"'"===o?J(I):I,ln:'"'===D||"'"===D?J(K):K});}function J(A){try{return (0, eval)(A)}catch(A){}}return [D,k,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMvLgABAQICAgICAgICAgICAgICAgIAAwMDBAQAAAADAAAAAAMDAAUGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUGw8gALfwBBsPIACwdwEwZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAmFpAAgCaWQACQJpcAAKAmVzAAsCZWUADANlbHMADQNlbGUADgJyaQAPAnJlABABZgARBXBhcnNlABILX19oZWFwX2Jhc2UDAQrAOy5oAQF/QQAgADYC9AlBACgC0AkiASAAQQF0aiIAQQA7AQBBACAAQQJqIgA2AvgJQQAgADYC/AlBAEEANgLUCUEAQQA2AuQJQQBBADYC3AlBAEEANgLYCUEAQQA2AuwJQQBBADYC4AkgAQufAQEDf0EAKALkCSEEQQBBACgC/AkiBTYC5AlBACAENgLoCUEAIAVBIGo2AvwJIARBHGpB1AkgBBsgBTYCAEEAKALICSEEQQAoAsQJIQYgBSABNgIAIAUgADYCCCAFIAIgAkECakEAIAYgA0YbIAQgA0YbNgIMIAUgA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MAZQByAHQAdgBvAHkAaQBlAGQAZQBsAGUAYwBvAG4AdABpAG4AaQBuAHMAdABhAG4AdAB5AGIAcgBlAGEAcgBlAHQAdQByAGQAZQBiAHUAZwBnAGUAYQB3AGEAaQB0AGgAcgB3AGgAaQBsAGUAZgBvAHIAaQBmAGMAYQB0AGMAZgBpAG4AYQBsAGwAZQBsAHMAAEHECQsQAQAAAAIAAAAABAAAMDkAAA==","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
|
|
15983
16018
|
|
|
15984
16019
|
const isDebug$6 = !!process.env.DEBUG;
|
|
15985
16020
|
const debug$e = createDebugger('vite:sourcemap', {
|
|
@@ -16037,7 +16072,7 @@ function getCodeWithSourcemap(type, code, map) {
|
|
|
16037
16072
|
return code;
|
|
16038
16073
|
}
|
|
16039
16074
|
|
|
16040
|
-
function e(e,n,r){throw new Error(r?`No known conditions for "${n}" specifier in "${e}" package`:`Missing "${n}" specifier in "${e}" package`)}function n(n,i,o,f){let s,u,l=r(n,o),c=function(e){let n=new Set(["default",...e.conditions||[]]);return e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node"),n}(f||{}),a=i[l];if(void 0===a){let e,n,r,t;for(t in i)n&&t.length<n.length||("/"===t[t.length-1]&&l.startsWith(t)?(u=l.substring(t.length),n=t):t.length>1&&(r=t.indexOf("*",2),~r&&(e=RegExp("^"+t.substring(0,r)+"(.*)"+t.substring(1+r)).exec(l),e&&e[1]&&(u=e[1],n=t))));a=i[n];}return a||e(n,l),s=t(a,c),s||e(n,l,1),u&&function(e,n){let r,t=0,i=e.length,o=/[*]/g
|
|
16075
|
+
function e(e,n,r){throw new Error(r?`No known conditions for "${n}" specifier in "${e}" package`:`Missing "${n}" specifier in "${e}" package`)}function n(n,i,o,f){let s,u,l=r(n,o),c=function(e){let n=new Set(["default",...e.conditions||[]]);return e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node"),n}(f||{}),a=i[l];if(void 0===a){let e,n,r,t;for(t in i)n&&t.length<n.length||("/"===t[t.length-1]&&l.startsWith(t)?(u=l.substring(t.length),n=t):t.length>1&&(r=t.indexOf("*",2),~r&&(e=RegExp("^"+t.substring(0,r)+"(.*)"+t.substring(1+r)).exec(l),e&&e[1]&&(u=e[1],n=t))));a=i[n];}return a||e(n,l),s=t(a,c),s||e(n,l,1),u&&function(e,n){let r,t=0,i=e.length,o=/[*]/g,f=/[/]$/;for(;t<i;t++)e[t]=o.test(r=e[t])?r.replace(o,n):f.test(r)?r+n:r;}(s,u),s}function r(e,n,r){if(e===n||"."===n)return ".";let t=e+"/",i=t.length,o=n.slice(0,i)===t,f=o?n.slice(i):n;return "#"===f[0]?f:o||!r?"./"===f.slice(0,2)?f:"./"+f:f}function t(e,n,r){if(e){if("string"==typeof e)return r&&r.add(e),[e];let i,o;if(Array.isArray(e)){for(o=r||new Set,i=0;i<e.length;i++)t(e[i],n,o);if(!r&&o.size)return [...o]}else for(i in e)if(n.has(i))return t(e[i],n,r)}}function o(e,r,t){let i,o=e.exports;if(o){if("string"==typeof o)o={".":o};else for(i in o){"."!==i[0]&&(o={".":o});break}return n(e.name,o,r||".",t)}}function f(e,r,t){if(e.imports)return n(e.name,e.imports,r,t)}
|
|
16041
16076
|
|
|
16042
16077
|
// This file was generated. Do not modify manually!
|
|
16043
16078
|
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
@@ -22348,6 +22383,14 @@ function webWorkerPlugin(config) {
|
|
|
22348
22383
|
const isBuild = config.command === 'build';
|
|
22349
22384
|
let server;
|
|
22350
22385
|
const isWorker = config.isWorker;
|
|
22386
|
+
const isWorkerQueryId = (id) => {
|
|
22387
|
+
const parsedQuery = parseRequest(id);
|
|
22388
|
+
if (parsedQuery &&
|
|
22389
|
+
(parsedQuery.worker ?? parsedQuery.sharedworker) != null) {
|
|
22390
|
+
return true;
|
|
22391
|
+
}
|
|
22392
|
+
return false;
|
|
22393
|
+
};
|
|
22351
22394
|
return {
|
|
22352
22395
|
name: 'vite:worker',
|
|
22353
22396
|
configureServer(_server) {
|
|
@@ -22364,13 +22407,15 @@ function webWorkerPlugin(config) {
|
|
|
22364
22407
|
});
|
|
22365
22408
|
},
|
|
22366
22409
|
load(id) {
|
|
22367
|
-
if (isBuild) {
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
|
|
22372
|
-
|
|
22410
|
+
if (isBuild && isWorkerQueryId(id)) {
|
|
22411
|
+
return '';
|
|
22412
|
+
}
|
|
22413
|
+
},
|
|
22414
|
+
shouldTransformCachedModule({ id }) {
|
|
22415
|
+
if (isBuild && isWorkerQueryId(id) && config.build.watch) {
|
|
22416
|
+
return true;
|
|
22373
22417
|
}
|
|
22418
|
+
return false;
|
|
22374
22419
|
},
|
|
22375
22420
|
async transform(raw, id, options) {
|
|
22376
22421
|
const ssr = options?.ssr === true;
|
|
@@ -22508,6 +22553,7 @@ const browserExternalId = '__vite-browser-external';
|
|
|
22508
22553
|
// special id for packages that are optional peer deps
|
|
22509
22554
|
const optionalPeerDepId = '__vite-optional-peer-dep';
|
|
22510
22555
|
const nodeModulesInPathRE = /(?:^|\/)node_modules\//;
|
|
22556
|
+
const subpathImportsPrefix = '#';
|
|
22511
22557
|
const isDebug$4 = process.env.DEBUG;
|
|
22512
22558
|
const debug$c = createDebugger('vite:resolve-details', {
|
|
22513
22559
|
onlyWhenFocused: true,
|
|
@@ -22533,6 +22579,22 @@ function resolvePlugin(resolveOptions) {
|
|
|
22533
22579
|
...resolveOptions,
|
|
22534
22580
|
scan: resolveOpts?.scan ?? resolveOptions.scan,
|
|
22535
22581
|
};
|
|
22582
|
+
const resolveSubpathImports = (id, importer) => {
|
|
22583
|
+
if (!importer || !id.startsWith(subpathImportsPrefix))
|
|
22584
|
+
return;
|
|
22585
|
+
const basedir = path$o.dirname(importer);
|
|
22586
|
+
const pkgJsonPath = lookupFile(basedir, ['package.json'], {
|
|
22587
|
+
pathOnly: true,
|
|
22588
|
+
});
|
|
22589
|
+
if (!pkgJsonPath)
|
|
22590
|
+
return;
|
|
22591
|
+
const pkgData = loadPackageData(pkgJsonPath, options.preserveSymlinks);
|
|
22592
|
+
return resolveExportsOrImports(pkgData.data, id, options, targetWeb, 'imports');
|
|
22593
|
+
};
|
|
22594
|
+
const resolvedImports = resolveSubpathImports(id, importer);
|
|
22595
|
+
if (resolvedImports) {
|
|
22596
|
+
id = resolvedImports;
|
|
22597
|
+
}
|
|
22536
22598
|
if (importer) {
|
|
22537
22599
|
const _importer = isWorkerRequest(importer)
|
|
22538
22600
|
? splitFileAndPostfix(importer).file
|
|
@@ -23102,7 +23164,7 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
|
|
|
23102
23164
|
// resolve exports field with highest priority
|
|
23103
23165
|
// using https://github.com/lukeed/resolve.exports
|
|
23104
23166
|
if (data.exports) {
|
|
23105
|
-
entryPoint =
|
|
23167
|
+
entryPoint = resolveExportsOrImports(data, '.', options, targetWeb, 'exports');
|
|
23106
23168
|
}
|
|
23107
23169
|
const resolvedFromExports = !!entryPoint;
|
|
23108
23170
|
// if exports resolved to .mjs, still resolve other fields.
|
|
@@ -23198,7 +23260,7 @@ function packageEntryFailure(id, details) {
|
|
|
23198
23260
|
(details ? ': ' + details : '.'));
|
|
23199
23261
|
}
|
|
23200
23262
|
const conditionalConditions = new Set(['production', 'development', 'module']);
|
|
23201
|
-
function
|
|
23263
|
+
function resolveExportsOrImports(pkg, key, options, targetWeb, type) {
|
|
23202
23264
|
const overrideConditions = options.overrideConditions
|
|
23203
23265
|
? new Set(options.overrideConditions)
|
|
23204
23266
|
: undefined;
|
|
@@ -23221,7 +23283,8 @@ function resolveExports(pkg, key, options, targetWeb) {
|
|
|
23221
23283
|
else if (options.conditions.length > 0) {
|
|
23222
23284
|
conditions.push(...options.conditions);
|
|
23223
23285
|
}
|
|
23224
|
-
const
|
|
23286
|
+
const fn = type === 'imports' ? f : o;
|
|
23287
|
+
const result = fn(pkg, key, {
|
|
23225
23288
|
browser: targetWeb && !conditions.includes('node'),
|
|
23226
23289
|
require: options.isRequire && !conditions.includes('import'),
|
|
23227
23290
|
conditions,
|
|
@@ -23240,7 +23303,7 @@ function resolveDeepImport(id, { webResolvedImports, setResolvedCache, getResolv
|
|
|
23240
23303
|
if (isObject$2(exportsField) && !Array.isArray(exportsField)) {
|
|
23241
23304
|
// resolve without postfix (see #7098)
|
|
23242
23305
|
const { file, postfix } = splitFileAndPostfix(relativeId);
|
|
23243
|
-
const exportsId =
|
|
23306
|
+
const exportsId = resolveExportsOrImports(data, file, options, targetWeb, 'exports');
|
|
23244
23307
|
if (exportsId !== undefined) {
|
|
23245
23308
|
relativeId = exportsId + postfix;
|
|
23246
23309
|
}
|
|
@@ -23286,8 +23349,9 @@ function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize
|
|
|
23286
23349
|
const mapId = isFilePath ? './' + slash$1(path$o.relative(pkg.dir, id)) : id;
|
|
23287
23350
|
const browserMappedPath = mapWithBrowserField(mapId, pkg.data.browser);
|
|
23288
23351
|
if (browserMappedPath) {
|
|
23289
|
-
|
|
23290
|
-
|
|
23352
|
+
if ((res = bareImportRE.test(browserMappedPath)
|
|
23353
|
+
? tryNodeResolve(browserMappedPath, importer, options, true)?.id
|
|
23354
|
+
: tryFsResolve(path$o.join(pkg.dir, browserMappedPath), options))) {
|
|
23291
23355
|
isDebug$4 &&
|
|
23292
23356
|
debug$c(`[browser mapped] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
|
|
23293
23357
|
idToPkgMap.set(res, pkg);
|
|
@@ -23477,9 +23541,12 @@ function esbuildDepPlugin(qualified, external, config, ssr) {
|
|
|
23477
23541
|
});
|
|
23478
23542
|
build.onLoad({ filter: /./, namespace: externalWithConversionNamespace }, (args) => {
|
|
23479
23543
|
// import itself with prefix (this is the actual part of require-import conversion)
|
|
23544
|
+
const modulePath = `"${convertedExternalPrefix}${args.path}"`;
|
|
23480
23545
|
return {
|
|
23481
|
-
contents:
|
|
23482
|
-
`
|
|
23546
|
+
contents: CSS_LANGS_RE.test(args.path)
|
|
23547
|
+
? `import ${modulePath};`
|
|
23548
|
+
: `export { default } from ${modulePath};` +
|
|
23549
|
+
`export * from ${modulePath};`,
|
|
23483
23550
|
loader: 'js',
|
|
23484
23551
|
};
|
|
23485
23552
|
});
|
|
@@ -36325,9 +36392,9 @@ const withTypeScriptLoader = (rcFunc) => {
|
|
|
36325
36392
|
|
|
36326
36393
|
try {
|
|
36327
36394
|
// Register TypeScript compiler instance
|
|
36328
|
-
registerer =
|
|
36395
|
+
registerer = __require('ts-node').register();
|
|
36329
36396
|
|
|
36330
|
-
return
|
|
36397
|
+
return __require(configFile)
|
|
36331
36398
|
} catch (err) {
|
|
36332
36399
|
if (err.code === 'MODULE_NOT_FOUND') {
|
|
36333
36400
|
throw new Error(
|
|
@@ -36456,6 +36523,322 @@ function stripLiteral(code) {
|
|
|
36456
36523
|
}
|
|
36457
36524
|
}
|
|
36458
36525
|
|
|
36526
|
+
var mainExports = {};
|
|
36527
|
+
var main$1 = {
|
|
36528
|
+
get exports(){ return mainExports; },
|
|
36529
|
+
set exports(v){ mainExports = v; },
|
|
36530
|
+
};
|
|
36531
|
+
|
|
36532
|
+
var name = "dotenv";
|
|
36533
|
+
var version$1 = "16.0.3";
|
|
36534
|
+
var description = "Loads environment variables from .env file";
|
|
36535
|
+
var main = "lib/main.js";
|
|
36536
|
+
var types = "lib/main.d.ts";
|
|
36537
|
+
var exports = {
|
|
36538
|
+
".": {
|
|
36539
|
+
require: "./lib/main.js",
|
|
36540
|
+
types: "./lib/main.d.ts",
|
|
36541
|
+
"default": "./lib/main.js"
|
|
36542
|
+
},
|
|
36543
|
+
"./config": "./config.js",
|
|
36544
|
+
"./config.js": "./config.js",
|
|
36545
|
+
"./lib/env-options": "./lib/env-options.js",
|
|
36546
|
+
"./lib/env-options.js": "./lib/env-options.js",
|
|
36547
|
+
"./lib/cli-options": "./lib/cli-options.js",
|
|
36548
|
+
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
36549
|
+
"./package.json": "./package.json"
|
|
36550
|
+
};
|
|
36551
|
+
var scripts = {
|
|
36552
|
+
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
36553
|
+
lint: "standard",
|
|
36554
|
+
"lint-readme": "standard-markdown",
|
|
36555
|
+
pretest: "npm run lint && npm run dts-check",
|
|
36556
|
+
test: "tap tests/*.js --100 -Rspec",
|
|
36557
|
+
prerelease: "npm test",
|
|
36558
|
+
release: "standard-version"
|
|
36559
|
+
};
|
|
36560
|
+
var repository = {
|
|
36561
|
+
type: "git",
|
|
36562
|
+
url: "git://github.com/motdotla/dotenv.git"
|
|
36563
|
+
};
|
|
36564
|
+
var keywords = [
|
|
36565
|
+
"dotenv",
|
|
36566
|
+
"env",
|
|
36567
|
+
".env",
|
|
36568
|
+
"environment",
|
|
36569
|
+
"variables",
|
|
36570
|
+
"config",
|
|
36571
|
+
"settings"
|
|
36572
|
+
];
|
|
36573
|
+
var readmeFilename = "README.md";
|
|
36574
|
+
var license = "BSD-2-Clause";
|
|
36575
|
+
var devDependencies = {
|
|
36576
|
+
"@types/node": "^17.0.9",
|
|
36577
|
+
decache: "^4.6.1",
|
|
36578
|
+
dtslint: "^3.7.0",
|
|
36579
|
+
sinon: "^12.0.1",
|
|
36580
|
+
standard: "^16.0.4",
|
|
36581
|
+
"standard-markdown": "^7.1.0",
|
|
36582
|
+
"standard-version": "^9.3.2",
|
|
36583
|
+
tap: "^15.1.6",
|
|
36584
|
+
tar: "^6.1.11",
|
|
36585
|
+
typescript: "^4.5.4"
|
|
36586
|
+
};
|
|
36587
|
+
var engines = {
|
|
36588
|
+
node: ">=12"
|
|
36589
|
+
};
|
|
36590
|
+
var require$$3 = {
|
|
36591
|
+
name: name,
|
|
36592
|
+
version: version$1,
|
|
36593
|
+
description: description,
|
|
36594
|
+
main: main,
|
|
36595
|
+
types: types,
|
|
36596
|
+
exports: exports,
|
|
36597
|
+
scripts: scripts,
|
|
36598
|
+
repository: repository,
|
|
36599
|
+
keywords: keywords,
|
|
36600
|
+
readmeFilename: readmeFilename,
|
|
36601
|
+
license: license,
|
|
36602
|
+
devDependencies: devDependencies,
|
|
36603
|
+
engines: engines
|
|
36604
|
+
};
|
|
36605
|
+
|
|
36606
|
+
const fs$9 = require$$0__default;
|
|
36607
|
+
const path$9 = require$$0$4;
|
|
36608
|
+
const os$2 = require$$2;
|
|
36609
|
+
const packageJson = require$$3;
|
|
36610
|
+
|
|
36611
|
+
const version = packageJson.version;
|
|
36612
|
+
|
|
36613
|
+
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
36614
|
+
|
|
36615
|
+
// Parser src into an Object
|
|
36616
|
+
function parse$9 (src) {
|
|
36617
|
+
const obj = {};
|
|
36618
|
+
|
|
36619
|
+
// Convert buffer to string
|
|
36620
|
+
let lines = src.toString();
|
|
36621
|
+
|
|
36622
|
+
// Convert line breaks to same format
|
|
36623
|
+
lines = lines.replace(/\r\n?/mg, '\n');
|
|
36624
|
+
|
|
36625
|
+
let match;
|
|
36626
|
+
while ((match = LINE.exec(lines)) != null) {
|
|
36627
|
+
const key = match[1];
|
|
36628
|
+
|
|
36629
|
+
// Default undefined or null to empty string
|
|
36630
|
+
let value = (match[2] || '');
|
|
36631
|
+
|
|
36632
|
+
// Remove whitespace
|
|
36633
|
+
value = value.trim();
|
|
36634
|
+
|
|
36635
|
+
// Check if double quoted
|
|
36636
|
+
const maybeQuote = value[0];
|
|
36637
|
+
|
|
36638
|
+
// Remove surrounding quotes
|
|
36639
|
+
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2');
|
|
36640
|
+
|
|
36641
|
+
// Expand newlines if double quoted
|
|
36642
|
+
if (maybeQuote === '"') {
|
|
36643
|
+
value = value.replace(/\\n/g, '\n');
|
|
36644
|
+
value = value.replace(/\\r/g, '\r');
|
|
36645
|
+
}
|
|
36646
|
+
|
|
36647
|
+
// Add to object
|
|
36648
|
+
obj[key] = value;
|
|
36649
|
+
}
|
|
36650
|
+
|
|
36651
|
+
return obj
|
|
36652
|
+
}
|
|
36653
|
+
|
|
36654
|
+
function _log (message) {
|
|
36655
|
+
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
36656
|
+
}
|
|
36657
|
+
|
|
36658
|
+
function _resolveHome (envPath) {
|
|
36659
|
+
return envPath[0] === '~' ? path$9.join(os$2.homedir(), envPath.slice(1)) : envPath
|
|
36660
|
+
}
|
|
36661
|
+
|
|
36662
|
+
// Populates process.env from .env file
|
|
36663
|
+
function config (options) {
|
|
36664
|
+
let dotenvPath = path$9.resolve(process.cwd(), '.env');
|
|
36665
|
+
let encoding = 'utf8';
|
|
36666
|
+
const debug = Boolean(options && options.debug);
|
|
36667
|
+
const override = Boolean(options && options.override);
|
|
36668
|
+
|
|
36669
|
+
if (options) {
|
|
36670
|
+
if (options.path != null) {
|
|
36671
|
+
dotenvPath = _resolveHome(options.path);
|
|
36672
|
+
}
|
|
36673
|
+
if (options.encoding != null) {
|
|
36674
|
+
encoding = options.encoding;
|
|
36675
|
+
}
|
|
36676
|
+
}
|
|
36677
|
+
|
|
36678
|
+
try {
|
|
36679
|
+
// Specifying an encoding returns a string instead of a buffer
|
|
36680
|
+
const parsed = DotenvModule.parse(fs$9.readFileSync(dotenvPath, { encoding }));
|
|
36681
|
+
|
|
36682
|
+
Object.keys(parsed).forEach(function (key) {
|
|
36683
|
+
if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
|
|
36684
|
+
process.env[key] = parsed[key];
|
|
36685
|
+
} else {
|
|
36686
|
+
if (override === true) {
|
|
36687
|
+
process.env[key] = parsed[key];
|
|
36688
|
+
}
|
|
36689
|
+
|
|
36690
|
+
if (debug) {
|
|
36691
|
+
if (override === true) {
|
|
36692
|
+
_log(`"${key}" is already defined in \`process.env\` and WAS overwritten`);
|
|
36693
|
+
} else {
|
|
36694
|
+
_log(`"${key}" is already defined in \`process.env\` and was NOT overwritten`);
|
|
36695
|
+
}
|
|
36696
|
+
}
|
|
36697
|
+
}
|
|
36698
|
+
});
|
|
36699
|
+
|
|
36700
|
+
return { parsed }
|
|
36701
|
+
} catch (e) {
|
|
36702
|
+
if (debug) {
|
|
36703
|
+
_log(`Failed to load ${dotenvPath} ${e.message}`);
|
|
36704
|
+
}
|
|
36705
|
+
|
|
36706
|
+
return { error: e }
|
|
36707
|
+
}
|
|
36708
|
+
}
|
|
36709
|
+
|
|
36710
|
+
const DotenvModule = {
|
|
36711
|
+
config,
|
|
36712
|
+
parse: parse$9
|
|
36713
|
+
};
|
|
36714
|
+
|
|
36715
|
+
mainExports.config = DotenvModule.config;
|
|
36716
|
+
var parse_1$1 = mainExports.parse = DotenvModule.parse;
|
|
36717
|
+
main$1.exports = DotenvModule;
|
|
36718
|
+
|
|
36719
|
+
function _interpolate (envValue, environment, config) {
|
|
36720
|
+
const matches = envValue.match(/(.?\${*[\w]*(?::-[\w/]*)?}*)/g) || [];
|
|
36721
|
+
|
|
36722
|
+
return matches.reduce(function (newEnv, match, index) {
|
|
36723
|
+
const parts = /(.?)\${*([\w]*(?::-[\w/]*)?)?}*/g.exec(match);
|
|
36724
|
+
if (!parts || parts.length === 0) {
|
|
36725
|
+
return newEnv
|
|
36726
|
+
}
|
|
36727
|
+
|
|
36728
|
+
const prefix = parts[1];
|
|
36729
|
+
|
|
36730
|
+
let value, replacePart;
|
|
36731
|
+
|
|
36732
|
+
if (prefix === '\\') {
|
|
36733
|
+
replacePart = parts[0];
|
|
36734
|
+
value = replacePart.replace('\\$', '$');
|
|
36735
|
+
} else {
|
|
36736
|
+
// PATCH: compatible with env variables ended with unescaped $
|
|
36737
|
+
if(!parts[2]) {
|
|
36738
|
+
return newEnv
|
|
36739
|
+
}
|
|
36740
|
+
const keyParts = parts[2].split(':-');
|
|
36741
|
+
const key = keyParts[0];
|
|
36742
|
+
replacePart = parts[0].substring(prefix.length);
|
|
36743
|
+
// process.env value 'wins' over .env file's value
|
|
36744
|
+
value = Object.prototype.hasOwnProperty.call(environment, key)
|
|
36745
|
+
? environment[key]
|
|
36746
|
+
: (config.parsed[key] || keyParts[1] || '');
|
|
36747
|
+
|
|
36748
|
+
// If the value is found, remove nested expansions.
|
|
36749
|
+
if (keyParts.length > 1 && value) {
|
|
36750
|
+
const replaceNested = matches[index + 1];
|
|
36751
|
+
matches[index + 1] = '';
|
|
36752
|
+
|
|
36753
|
+
newEnv = newEnv.replace(replaceNested, '');
|
|
36754
|
+
}
|
|
36755
|
+
// Resolve recursive interpolations
|
|
36756
|
+
value = _interpolate(value, environment, config);
|
|
36757
|
+
}
|
|
36758
|
+
|
|
36759
|
+
return newEnv.replace(replacePart, value)
|
|
36760
|
+
}, envValue)
|
|
36761
|
+
}
|
|
36762
|
+
|
|
36763
|
+
function expand (config) {
|
|
36764
|
+
// if ignoring process.env, use a blank object
|
|
36765
|
+
const environment = config.ignoreProcessEnv ? {} : process.env;
|
|
36766
|
+
|
|
36767
|
+
for (const configKey in config.parsed) {
|
|
36768
|
+
const value = Object.prototype.hasOwnProperty.call(environment, configKey) ? environment[configKey] : config.parsed[configKey];
|
|
36769
|
+
|
|
36770
|
+
config.parsed[configKey] = _interpolate(value, environment, config);
|
|
36771
|
+
}
|
|
36772
|
+
|
|
36773
|
+
// PATCH: don't write to process.env
|
|
36774
|
+
// for (const processKey in config.parsed) {
|
|
36775
|
+
// environment[processKey] = config.parsed[processKey]
|
|
36776
|
+
// }
|
|
36777
|
+
|
|
36778
|
+
return config
|
|
36779
|
+
}
|
|
36780
|
+
|
|
36781
|
+
var expand_1 = expand;
|
|
36782
|
+
|
|
36783
|
+
function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
36784
|
+
if (mode === 'local') {
|
|
36785
|
+
throw new Error(`"local" cannot be used as a mode name because it conflicts with ` +
|
|
36786
|
+
`the .local postfix for .env files.`);
|
|
36787
|
+
}
|
|
36788
|
+
prefixes = arraify(prefixes);
|
|
36789
|
+
const env = {};
|
|
36790
|
+
const envFiles = [
|
|
36791
|
+
/** default file */ `.env`,
|
|
36792
|
+
/** local file */ `.env.local`,
|
|
36793
|
+
/** mode file */ `.env.${mode}`,
|
|
36794
|
+
/** mode local file */ `.env.${mode}.local`,
|
|
36795
|
+
];
|
|
36796
|
+
const parsed = Object.fromEntries(envFiles.flatMap((file) => {
|
|
36797
|
+
const path = lookupFile(envDir, [file], {
|
|
36798
|
+
pathOnly: true,
|
|
36799
|
+
rootDir: envDir,
|
|
36800
|
+
});
|
|
36801
|
+
if (!path)
|
|
36802
|
+
return [];
|
|
36803
|
+
return Object.entries(parse_1$1(fs$l.readFileSync(path)));
|
|
36804
|
+
}));
|
|
36805
|
+
// test NODE_ENV override before expand as otherwise process.env.NODE_ENV would override this
|
|
36806
|
+
if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) {
|
|
36807
|
+
process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV;
|
|
36808
|
+
}
|
|
36809
|
+
// support BROWSER and BROWSER_ARGS env variables
|
|
36810
|
+
if (parsed.BROWSER && process.env.BROWSER === undefined) {
|
|
36811
|
+
process.env.BROWSER = parsed.BROWSER;
|
|
36812
|
+
}
|
|
36813
|
+
if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === undefined) {
|
|
36814
|
+
process.env.BROWSER_ARGS = parsed.BROWSER_ARGS;
|
|
36815
|
+
}
|
|
36816
|
+
// let environment variables use each other
|
|
36817
|
+
// `expand` patched in patches/dotenv-expand@9.0.0.patch
|
|
36818
|
+
expand_1({ parsed });
|
|
36819
|
+
// only keys that start with prefix are exposed to client
|
|
36820
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
36821
|
+
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
36822
|
+
env[key] = value;
|
|
36823
|
+
}
|
|
36824
|
+
}
|
|
36825
|
+
// check if there are actual env variables starting with VITE_*
|
|
36826
|
+
// these are typically provided inline and should be prioritized
|
|
36827
|
+
for (const key in process.env) {
|
|
36828
|
+
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
36829
|
+
env[key] = process.env[key];
|
|
36830
|
+
}
|
|
36831
|
+
}
|
|
36832
|
+
return env;
|
|
36833
|
+
}
|
|
36834
|
+
function resolveEnvPrefix({ envPrefix = 'VITE_', }) {
|
|
36835
|
+
envPrefix = arraify(envPrefix);
|
|
36836
|
+
if (envPrefix.some((prefix) => prefix === '')) {
|
|
36837
|
+
throw new Error(`envPrefix option contains value '', which could lead unexpected exposure of sensitive information.`);
|
|
36838
|
+
}
|
|
36839
|
+
return envPrefix;
|
|
36840
|
+
}
|
|
36841
|
+
|
|
36459
36842
|
const modulePreloadPolyfillId = 'vite/modulepreload-polyfill';
|
|
36460
36843
|
const resolvedModulePreloadPolyfillId = '\0' + modulePreloadPolyfillId;
|
|
36461
36844
|
function modulePreloadPolyfillPlugin(config) {
|
|
@@ -36696,6 +37079,7 @@ function handleParseError(parserError, html, filePath) {
|
|
|
36696
37079
|
function buildHtmlPlugin(config) {
|
|
36697
37080
|
const [preHooks, normalHooks, postHooks] = resolveHtmlTransforms(config.plugins);
|
|
36698
37081
|
preHooks.unshift(preImportMapHook(config));
|
|
37082
|
+
normalHooks.unshift(htmlEnvHook(config));
|
|
36699
37083
|
postHooks.push(postImportMapHook());
|
|
36700
37084
|
const processedHtml = new Map();
|
|
36701
37085
|
const isExcludedUrl = (url) => url.startsWith('#') ||
|
|
@@ -37125,6 +37509,36 @@ function postImportMapHook() {
|
|
|
37125
37509
|
return html;
|
|
37126
37510
|
};
|
|
37127
37511
|
}
|
|
37512
|
+
/**
|
|
37513
|
+
* Support `%ENV_NAME%` syntax in html files
|
|
37514
|
+
*/
|
|
37515
|
+
function htmlEnvHook(config) {
|
|
37516
|
+
const pattern = /%(\S+?)%/g;
|
|
37517
|
+
const envPrefix = resolveEnvPrefix({ envPrefix: config.envPrefix });
|
|
37518
|
+
const env = { ...config.env };
|
|
37519
|
+
// account for user env defines
|
|
37520
|
+
for (const key in config.define) {
|
|
37521
|
+
if (key.startsWith(`import.meta.env.`)) {
|
|
37522
|
+
const val = config.define[key];
|
|
37523
|
+
env[key.slice(16)] = typeof val === 'string' ? val : JSON.stringify(val);
|
|
37524
|
+
}
|
|
37525
|
+
}
|
|
37526
|
+
return (html, ctx) => {
|
|
37527
|
+
return html.replace(pattern, (text, key) => {
|
|
37528
|
+
if (key in env) {
|
|
37529
|
+
return env[key];
|
|
37530
|
+
}
|
|
37531
|
+
else {
|
|
37532
|
+
if (envPrefix.some((prefix) => key.startsWith(prefix))) {
|
|
37533
|
+
const relativeHtml = normalizePath$3(path$o.relative(config.root, ctx.filename));
|
|
37534
|
+
config.logger.warn(picocolorsExports.yellow(picocolorsExports.bold(`(!) ${text} is not defined in env variables found in /${relativeHtml}. ` +
|
|
37535
|
+
`Is the variable mistyped?`)));
|
|
37536
|
+
}
|
|
37537
|
+
return text;
|
|
37538
|
+
}
|
|
37539
|
+
});
|
|
37540
|
+
};
|
|
37541
|
+
}
|
|
37128
37542
|
function resolveHtmlTransforms(plugins) {
|
|
37129
37543
|
const preHooks = [];
|
|
37130
37544
|
const normalHooks = [];
|
|
@@ -37539,7 +37953,7 @@ function cssPostPlugin(config) {
|
|
|
37539
37953
|
}
|
|
37540
37954
|
else {
|
|
37541
37955
|
let content = css;
|
|
37542
|
-
if (config.build.
|
|
37956
|
+
if (config.build.cssMinify) {
|
|
37543
37957
|
content = await minifyCSS(content, config);
|
|
37544
37958
|
}
|
|
37545
37959
|
code = `export default ${JSON.stringify(content)}`;
|
|
@@ -37767,6 +38181,7 @@ function createCSSResolvers(config) {
|
|
|
37767
38181
|
(cssResolve = config.createResolver({
|
|
37768
38182
|
extensions: ['.css'],
|
|
37769
38183
|
mainFields: ['style'],
|
|
38184
|
+
conditions: ['style'],
|
|
37770
38185
|
tryIndex: false,
|
|
37771
38186
|
preferRelative: true,
|
|
37772
38187
|
})));
|
|
@@ -37776,6 +38191,7 @@ function createCSSResolvers(config) {
|
|
|
37776
38191
|
(sassResolve = config.createResolver({
|
|
37777
38192
|
extensions: ['.scss', '.sass', '.css'],
|
|
37778
38193
|
mainFields: ['sass', 'style'],
|
|
38194
|
+
conditions: ['sass', 'style'],
|
|
37779
38195
|
tryIndex: true,
|
|
37780
38196
|
tryPrefix: '_',
|
|
37781
38197
|
preferRelative: true,
|
|
@@ -37786,6 +38202,7 @@ function createCSSResolvers(config) {
|
|
|
37786
38202
|
(lessResolve = config.createResolver({
|
|
37787
38203
|
extensions: ['.less', '.css'],
|
|
37788
38204
|
mainFields: ['less', 'style'],
|
|
38205
|
+
conditions: ['less', 'style'],
|
|
37789
38206
|
tryIndex: false,
|
|
37790
38207
|
preferRelative: true,
|
|
37791
38208
|
})));
|
|
@@ -37894,7 +38311,7 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
37894
38311
|
}));
|
|
37895
38312
|
}
|
|
37896
38313
|
if (isModule) {
|
|
37897
|
-
postcssPlugins.unshift((await import('./dep-
|
|
38314
|
+
postcssPlugins.unshift((await import('./dep-80b98891.js').then(function (n) { return n.i; })).default({
|
|
37898
38315
|
...modulesOptions,
|
|
37899
38316
|
localsConvention: modulesOptions?.localsConvention,
|
|
37900
38317
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
@@ -38045,7 +38462,7 @@ async function finalizeCss(css, minify, config) {
|
|
|
38045
38462
|
if (css.includes('@import') || css.includes('@charset')) {
|
|
38046
38463
|
css = await hoistAtRules(css);
|
|
38047
38464
|
}
|
|
38048
|
-
if (minify && config.build.
|
|
38465
|
+
if (minify && config.build.cssMinify) {
|
|
38049
38466
|
css = await minifyCSS(css, config);
|
|
38050
38467
|
}
|
|
38051
38468
|
return css;
|
|
@@ -38554,6 +38971,11 @@ const styl = async (source, root, options) => {
|
|
|
38554
38971
|
const importsDeps = (options.imports ?? []).map((dep) => path$o.resolve(dep));
|
|
38555
38972
|
try {
|
|
38556
38973
|
const ref = nodeStylus(content, options);
|
|
38974
|
+
if (options.define) {
|
|
38975
|
+
for (const key in options.define) {
|
|
38976
|
+
ref.define(key, options.define[key]);
|
|
38977
|
+
}
|
|
38978
|
+
}
|
|
38557
38979
|
if (options.enableSourcemap) {
|
|
38558
38980
|
ref.set('sourcemap', {
|
|
38559
38981
|
comment: false,
|
|
@@ -40128,7 +40550,7 @@ function totalist(dir, callback, pre='') {
|
|
|
40128
40550
|
* @param {Request} req
|
|
40129
40551
|
* @returns {ParsedURL|void}
|
|
40130
40552
|
*/
|
|
40131
|
-
function parse$
|
|
40553
|
+
function parse$8(req) {
|
|
40132
40554
|
let raw = req.url;
|
|
40133
40555
|
if (raw == null) return;
|
|
40134
40556
|
|
|
@@ -40310,7 +40732,7 @@ function sirv (dir, opts={}) {
|
|
|
40310
40732
|
|
|
40311
40733
|
return function (req, res, next) {
|
|
40312
40734
|
let extns = [''];
|
|
40313
|
-
let pathname = parse$
|
|
40735
|
+
let pathname = parse$8(req).pathname;
|
|
40314
40736
|
let val = req.headers['accept-encoding'] || '';
|
|
40315
40737
|
if (gzips && val.includes('gzip')) extns.unshift(...gzips);
|
|
40316
40738
|
if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
|
|
@@ -40693,12 +41115,27 @@ async function loadAndTransform(id, url, server, options, timestamp) {
|
|
|
40693
41115
|
}
|
|
40694
41116
|
for (let sourcesIndex = 0; sourcesIndex < map.sources.length; ++sourcesIndex) {
|
|
40695
41117
|
const sourcePath = map.sources[sourcesIndex];
|
|
41118
|
+
if (!sourcePath)
|
|
41119
|
+
continue;
|
|
41120
|
+
const sourcemapPath = `${mod.file}.map`;
|
|
41121
|
+
const ignoreList = config.server.sourcemapIgnoreList(path$o.isAbsolute(sourcePath)
|
|
41122
|
+
? sourcePath
|
|
41123
|
+
: path$o.resolve(path$o.dirname(sourcemapPath), sourcePath), sourcemapPath);
|
|
41124
|
+
if (typeof ignoreList !== 'boolean') {
|
|
41125
|
+
logger.warn('sourcemapIgnoreList function must return a boolean.');
|
|
41126
|
+
}
|
|
41127
|
+
if (ignoreList) {
|
|
41128
|
+
if (map.x_google_ignoreList === undefined) {
|
|
41129
|
+
map.x_google_ignoreList = [];
|
|
41130
|
+
}
|
|
41131
|
+
if (!map.x_google_ignoreList.includes(sourcesIndex)) {
|
|
41132
|
+
map.x_google_ignoreList.push(sourcesIndex);
|
|
41133
|
+
}
|
|
41134
|
+
}
|
|
40696
41135
|
// Rewrite sources to relative paths to give debuggers the chance
|
|
40697
41136
|
// to resolve and display them in a meaningful way (rather than
|
|
40698
41137
|
// with absolute paths).
|
|
40699
|
-
if (sourcePath &&
|
|
40700
|
-
path$o.isAbsolute(sourcePath) &&
|
|
40701
|
-
path$o.isAbsolute(mod.file)) {
|
|
41138
|
+
if (path$o.isAbsolute(sourcePath) && path$o.isAbsolute(mod.file)) {
|
|
40702
41139
|
map.sources[sourcesIndex] = path$o.relative(path$o.dirname(mod.file), sourcePath);
|
|
40703
41140
|
}
|
|
40704
41141
|
}
|
|
@@ -40815,7 +41252,7 @@ function importAnalysisPlugin(config) {
|
|
|
40815
41252
|
if (!_env) {
|
|
40816
41253
|
_env = `import.meta.env = ${JSON.stringify({
|
|
40817
41254
|
...config.env,
|
|
40818
|
-
SSR: '
|
|
41255
|
+
SSR: '__vite__ssr__',
|
|
40819
41256
|
})};`;
|
|
40820
41257
|
// account for user env defines
|
|
40821
41258
|
for (const key in config.define) {
|
|
@@ -40825,7 +41262,7 @@ function importAnalysisPlugin(config) {
|
|
|
40825
41262
|
}
|
|
40826
41263
|
}
|
|
40827
41264
|
}
|
|
40828
|
-
return _env.replace('"
|
|
41265
|
+
return _env.replace('"__vite__ssr__"', ssr + '');
|
|
40829
41266
|
}
|
|
40830
41267
|
return {
|
|
40831
41268
|
name: 'vite:import-analysis',
|
|
@@ -41626,7 +42063,7 @@ function definePlugin(config) {
|
|
|
41626
42063
|
// stringified for `import.meta.env`, we can remove the quotes and
|
|
41627
42064
|
// retain being an identifier
|
|
41628
42065
|
typeof val === 'string' && /^[\p{L}_$]/u.test(val.trim())
|
|
41629
|
-
? `
|
|
42066
|
+
? `__vite__define__${val}`
|
|
41630
42067
|
: val;
|
|
41631
42068
|
}
|
|
41632
42069
|
}
|
|
@@ -41635,27 +42072,43 @@ function definePlugin(config) {
|
|
|
41635
42072
|
const importMetaKeys = {};
|
|
41636
42073
|
const importMetaFallbackKeys = {};
|
|
41637
42074
|
if (isBuild) {
|
|
41638
|
-
const env = {
|
|
41639
|
-
...config.env,
|
|
41640
|
-
SSR: !!config.build.ssr,
|
|
41641
|
-
};
|
|
41642
42075
|
// set here to allow override with config.define
|
|
41643
42076
|
importMetaKeys['import.meta.hot'] = `undefined`;
|
|
41644
|
-
for (const key in env) {
|
|
41645
|
-
importMetaKeys[`import.meta.env.${key}`] = JSON.stringify(env[key]);
|
|
42077
|
+
for (const key in config.env) {
|
|
42078
|
+
importMetaKeys[`import.meta.env.${key}`] = JSON.stringify(config.env[key]);
|
|
41646
42079
|
}
|
|
41647
42080
|
Object.assign(importMetaFallbackKeys, {
|
|
41648
42081
|
'import.meta.env.': `({}).`,
|
|
41649
|
-
'import.meta.env': JSON.stringify({
|
|
42082
|
+
'import.meta.env': JSON.stringify({
|
|
42083
|
+
...config.env,
|
|
42084
|
+
SSR: '__vite__ssr__',
|
|
42085
|
+
...userDefineEnv,
|
|
42086
|
+
}).replace(/"__vite__define__(.+?)"/g, (_, val) => val),
|
|
41650
42087
|
});
|
|
41651
42088
|
}
|
|
42089
|
+
function getImportMetaKeys(ssr) {
|
|
42090
|
+
if (!isBuild)
|
|
42091
|
+
return {};
|
|
42092
|
+
return {
|
|
42093
|
+
...importMetaKeys,
|
|
42094
|
+
'import.meta.env.SSR': ssr + '',
|
|
42095
|
+
};
|
|
42096
|
+
}
|
|
42097
|
+
function getImportMetaFallbackKeys(ssr) {
|
|
42098
|
+
if (!isBuild)
|
|
42099
|
+
return {};
|
|
42100
|
+
return {
|
|
42101
|
+
...importMetaFallbackKeys,
|
|
42102
|
+
'import.meta.env': importMetaFallbackKeys['import.meta.env'].replace('"__vite__ssr__"', ssr + ''),
|
|
42103
|
+
};
|
|
42104
|
+
}
|
|
41652
42105
|
function generatePattern(ssr) {
|
|
41653
42106
|
const replaceProcessEnv = !ssr || config.ssr?.target === 'webworker';
|
|
41654
42107
|
const replacements = {
|
|
41655
42108
|
...(replaceProcessEnv ? processNodeEnv : {}),
|
|
41656
|
-
...
|
|
42109
|
+
...getImportMetaKeys(ssr),
|
|
41657
42110
|
...userDefine,
|
|
41658
|
-
...
|
|
42111
|
+
...getImportMetaFallbackKeys(ssr),
|
|
41659
42112
|
...(replaceProcessEnv ? processEnv : {}),
|
|
41660
42113
|
};
|
|
41661
42114
|
if (isBuild && !replaceProcessEnv) {
|
|
@@ -42701,7 +43154,9 @@ async function createPluginContainer(config, moduleGraph, watcher) {
|
|
|
42701
43154
|
};
|
|
42702
43155
|
err.frame = err.frame || generateCodeFrame(err.id, err.loc);
|
|
42703
43156
|
}
|
|
42704
|
-
if (
|
|
43157
|
+
if (ctx instanceof TransformContext &&
|
|
43158
|
+
typeof err.loc?.line === 'number' &&
|
|
43159
|
+
typeof err.loc?.column === 'number') {
|
|
42705
43160
|
const rawSourceMap = ctx._getCombinedSourcemap();
|
|
42706
43161
|
if (rawSourceMap) {
|
|
42707
43162
|
const traced = new TraceMap(rawSourceMap);
|
|
@@ -42732,6 +43187,11 @@ async function createPluginContainer(config, moduleGraph, watcher) {
|
|
|
42732
43187
|
}
|
|
42733
43188
|
}
|
|
42734
43189
|
}
|
|
43190
|
+
if (typeof err.loc?.column !== 'number' &&
|
|
43191
|
+
typeof err.loc?.line !== 'number' &&
|
|
43192
|
+
!err.loc?.file) {
|
|
43193
|
+
delete err.loc;
|
|
43194
|
+
}
|
|
42735
43195
|
return err;
|
|
42736
43196
|
}
|
|
42737
43197
|
class TransformContext extends Context {
|
|
@@ -42968,9 +43428,87 @@ const htmlTypesRE = /\.(html|vue|svelte|astro|imba)$/;
|
|
|
42968
43428
|
// since even missed imports can be caught at runtime, and false positives will
|
|
42969
43429
|
// simply be ignored.
|
|
42970
43430
|
const importsRE = /(?<!\/\/.*)(?<=^|;|\*\/)\s*import(?!\s+type)(?:[\w*{}\n\r\t, ]+from)?\s*("[^"]+"|'[^']+')\s*(?=$|;|\/\/|\/\*)/gm;
|
|
42971
|
-
|
|
43431
|
+
function scanImports(config) {
|
|
42972
43432
|
// Only used to scan non-ssr code
|
|
42973
43433
|
const start = performance.now();
|
|
43434
|
+
const deps = {};
|
|
43435
|
+
const missing = {};
|
|
43436
|
+
let entries;
|
|
43437
|
+
const scanContext = { cancelled: false };
|
|
43438
|
+
const esbuildContext = computeEntries(config).then((computedEntries) => {
|
|
43439
|
+
entries = computedEntries;
|
|
43440
|
+
if (!entries.length) {
|
|
43441
|
+
if (!config.optimizeDeps.entries && !config.optimizeDeps.include) {
|
|
43442
|
+
config.logger.warn(picocolorsExports.yellow('(!) Could not auto-determine entry point from rollupOptions or html files ' +
|
|
43443
|
+
'and there are no explicit optimizeDeps.include patterns. ' +
|
|
43444
|
+
'Skipping dependency pre-bundling.'));
|
|
43445
|
+
}
|
|
43446
|
+
return;
|
|
43447
|
+
}
|
|
43448
|
+
if (scanContext.cancelled)
|
|
43449
|
+
return;
|
|
43450
|
+
debug$8(`Crawling dependencies using entries:\n ${entries.join('\n ')}`);
|
|
43451
|
+
return prepareEsbuildScanner(config, entries, deps, missing, scanContext);
|
|
43452
|
+
});
|
|
43453
|
+
const result = esbuildContext
|
|
43454
|
+
.then((context) => {
|
|
43455
|
+
function disposeContext() {
|
|
43456
|
+
return context?.dispose().catch((e) => {
|
|
43457
|
+
config.logger.error('Failed to dispose esbuild context', { error: e });
|
|
43458
|
+
});
|
|
43459
|
+
}
|
|
43460
|
+
if (!context || scanContext?.cancelled) {
|
|
43461
|
+
disposeContext();
|
|
43462
|
+
return { deps: {}, missing: {} };
|
|
43463
|
+
}
|
|
43464
|
+
return context
|
|
43465
|
+
.rebuild()
|
|
43466
|
+
.then(() => {
|
|
43467
|
+
return {
|
|
43468
|
+
// Ensure a fixed order so hashes are stable and improve logs
|
|
43469
|
+
deps: orderedDependencies(deps),
|
|
43470
|
+
missing,
|
|
43471
|
+
};
|
|
43472
|
+
})
|
|
43473
|
+
.finally(() => {
|
|
43474
|
+
return disposeContext();
|
|
43475
|
+
});
|
|
43476
|
+
})
|
|
43477
|
+
.catch(async (e) => {
|
|
43478
|
+
if (e.errors && e.message.includes('The build was canceled')) {
|
|
43479
|
+
// esbuild logs an error when cancelling, but this is expected so
|
|
43480
|
+
// return an empty result instead
|
|
43481
|
+
return { deps: {}, missing: {} };
|
|
43482
|
+
}
|
|
43483
|
+
const prependMessage = picocolorsExports.red(`\
|
|
43484
|
+
Failed to scan for dependencies from entries:
|
|
43485
|
+
${entries.join('\n')}
|
|
43486
|
+
|
|
43487
|
+
`);
|
|
43488
|
+
if (e.errors) {
|
|
43489
|
+
const msgs = await formatMessages(e.errors, {
|
|
43490
|
+
kind: 'error',
|
|
43491
|
+
color: true,
|
|
43492
|
+
});
|
|
43493
|
+
e.message = prependMessage + msgs.join('\n');
|
|
43494
|
+
}
|
|
43495
|
+
else {
|
|
43496
|
+
e.message = prependMessage + e.message;
|
|
43497
|
+
}
|
|
43498
|
+
throw e;
|
|
43499
|
+
})
|
|
43500
|
+
.finally(() => {
|
|
43501
|
+
debug$8(`Scan completed in ${(performance.now() - start).toFixed(2)}ms:`, deps);
|
|
43502
|
+
});
|
|
43503
|
+
return {
|
|
43504
|
+
cancel: async () => {
|
|
43505
|
+
scanContext.cancelled = true;
|
|
43506
|
+
return esbuildContext.then((context) => context?.cancel());
|
|
43507
|
+
},
|
|
43508
|
+
result,
|
|
43509
|
+
};
|
|
43510
|
+
}
|
|
43511
|
+
async function computeEntries(config) {
|
|
42974
43512
|
let entries = [];
|
|
42975
43513
|
const explicitEntryPatterns = config.optimizeDeps.entries;
|
|
42976
43514
|
const buildInput = config.build.rollupOptions?.input;
|
|
@@ -42998,61 +43536,27 @@ async function scanImports(config) {
|
|
|
42998
43536
|
// Non-supported entry file types and virtual files should not be scanned for
|
|
42999
43537
|
// dependencies.
|
|
43000
43538
|
entries = entries.filter((entry) => isScannable(entry) && fs$l.existsSync(entry));
|
|
43001
|
-
|
|
43002
|
-
|
|
43003
|
-
|
|
43004
|
-
'and there are no explicit optimizeDeps.include patterns. ' +
|
|
43005
|
-
'Skipping dependency pre-bundling.'));
|
|
43006
|
-
}
|
|
43007
|
-
return { deps: {}, missing: {} };
|
|
43008
|
-
}
|
|
43009
|
-
else {
|
|
43010
|
-
debug$8(`Crawling dependencies using entries:\n ${entries.join('\n ')}`);
|
|
43011
|
-
}
|
|
43012
|
-
const deps = {};
|
|
43013
|
-
const missing = {};
|
|
43539
|
+
return entries;
|
|
43540
|
+
}
|
|
43541
|
+
async function prepareEsbuildScanner(config, entries, deps, missing, scanContext) {
|
|
43014
43542
|
const container = await createPluginContainer(config);
|
|
43543
|
+
if (scanContext?.cancelled)
|
|
43544
|
+
return;
|
|
43015
43545
|
const plugin = esbuildScanPlugin(config, container, deps, missing, entries);
|
|
43016
43546
|
const { plugins = [], ...esbuildOptions } = config.optimizeDeps?.esbuildOptions ?? {};
|
|
43017
|
-
|
|
43018
|
-
|
|
43019
|
-
|
|
43020
|
-
|
|
43021
|
-
|
|
43022
|
-
|
|
43023
|
-
|
|
43024
|
-
|
|
43025
|
-
|
|
43026
|
-
|
|
43027
|
-
|
|
43028
|
-
|
|
43029
|
-
|
|
43030
|
-
});
|
|
43031
|
-
}
|
|
43032
|
-
catch (e) {
|
|
43033
|
-
const prependMessage = picocolorsExports.red(`\
|
|
43034
|
-
Failed to scan for dependencies from entries:
|
|
43035
|
-
${entries.join('\n')}
|
|
43036
|
-
|
|
43037
|
-
`);
|
|
43038
|
-
if (e.errors) {
|
|
43039
|
-
const msgs = await formatMessages(e.errors, {
|
|
43040
|
-
kind: 'error',
|
|
43041
|
-
color: true,
|
|
43042
|
-
});
|
|
43043
|
-
e.message = prependMessage + msgs.join('\n');
|
|
43044
|
-
}
|
|
43045
|
-
else {
|
|
43046
|
-
e.message = prependMessage + e.message;
|
|
43047
|
-
}
|
|
43048
|
-
throw e;
|
|
43049
|
-
}
|
|
43050
|
-
debug$8(`Scan completed in ${(performance.now() - start).toFixed(2)}ms:`, deps);
|
|
43051
|
-
return {
|
|
43052
|
-
// Ensure a fixed order so hashes are stable and improve logs
|
|
43053
|
-
deps: orderedDependencies(deps),
|
|
43054
|
-
missing,
|
|
43055
|
-
};
|
|
43547
|
+
return await esbuild.context({
|
|
43548
|
+
absWorkingDir: process.cwd(),
|
|
43549
|
+
write: false,
|
|
43550
|
+
stdin: {
|
|
43551
|
+
contents: entries.map((e) => `import ${JSON.stringify(e)}`).join('\n'),
|
|
43552
|
+
loader: 'js',
|
|
43553
|
+
},
|
|
43554
|
+
bundle: true,
|
|
43555
|
+
format: 'esm',
|
|
43556
|
+
logLevel: 'silent',
|
|
43557
|
+
plugins: [...plugins, plugin],
|
|
43558
|
+
...esbuildOptions,
|
|
43559
|
+
});
|
|
43056
43560
|
}
|
|
43057
43561
|
function orderedDependencies(deps) {
|
|
43058
43562
|
const depsList = Object.entries(deps);
|
|
@@ -43491,13 +43995,15 @@ async function createDepsOptimizer(config, server) {
|
|
|
43491
43995
|
let currentlyProcessing = false;
|
|
43492
43996
|
// If there wasn't a cache or it is outdated, we need to prepare a first run
|
|
43493
43997
|
let firstRunCalled = !!cachedMetadata;
|
|
43494
|
-
let
|
|
43998
|
+
let optimizationResult;
|
|
43999
|
+
let discover;
|
|
43495
44000
|
let optimizingNewDeps;
|
|
43496
44001
|
async function close() {
|
|
43497
44002
|
closed = true;
|
|
43498
44003
|
await Promise.allSettled([
|
|
44004
|
+
discover?.cancel(),
|
|
43499
44005
|
depsOptimizer.scanProcessing,
|
|
43500
|
-
|
|
44006
|
+
optimizationResult?.cancel(),
|
|
43501
44007
|
optimizingNewDeps,
|
|
43502
44008
|
]);
|
|
43503
44009
|
}
|
|
@@ -43522,7 +44028,9 @@ async function createDepsOptimizer(config, server) {
|
|
|
43522
44028
|
setTimeout(async () => {
|
|
43523
44029
|
try {
|
|
43524
44030
|
debuggerViteDeps(picocolorsExports.green(`scanning for dependencies...`));
|
|
43525
|
-
|
|
44031
|
+
discover = discoverProjectDependencies(config);
|
|
44032
|
+
const deps = await discover.result;
|
|
44033
|
+
discover = undefined;
|
|
43526
44034
|
debuggerViteDeps(picocolorsExports.green(Object.keys(deps).length > 0
|
|
43527
44035
|
? `dependencies found by scanner: ${depsLogString(Object.keys(deps))}`
|
|
43528
44036
|
: `no dependencies found by scanner`));
|
|
@@ -43539,7 +44047,7 @@ async function createDepsOptimizer(config, server) {
|
|
|
43539
44047
|
// run on the background, but we wait until crawling has ended
|
|
43540
44048
|
// to decide if we send this result to the browser or we need to
|
|
43541
44049
|
// do another optimize step
|
|
43542
|
-
|
|
44050
|
+
optimizationResult = runOptimizeDeps(config, knownDeps);
|
|
43543
44051
|
}
|
|
43544
44052
|
catch (e) {
|
|
43545
44053
|
logger.error(e.stack || e.message);
|
|
@@ -43573,7 +44081,8 @@ async function createDepsOptimizer(config, server) {
|
|
|
43573
44081
|
// respect insertion order to keep the metadata file stable
|
|
43574
44082
|
const knownDeps = prepareKnownDeps();
|
|
43575
44083
|
startNextDiscoveredBatch();
|
|
43576
|
-
|
|
44084
|
+
optimizationResult = runOptimizeDeps(config, knownDeps);
|
|
44085
|
+
return await optimizationResult.result;
|
|
43577
44086
|
}
|
|
43578
44087
|
function prepareKnownDeps() {
|
|
43579
44088
|
const knownDeps = {};
|
|
@@ -43814,9 +44323,9 @@ async function createDepsOptimizer(config, server) {
|
|
|
43814
44323
|
// Await for the scan+optimize step running in the background
|
|
43815
44324
|
// It normally should be over by the time crawling of user code ended
|
|
43816
44325
|
await depsOptimizer.scanProcessing;
|
|
43817
|
-
if (!isBuild &&
|
|
43818
|
-
const result = await
|
|
43819
|
-
|
|
44326
|
+
if (!isBuild && optimizationResult) {
|
|
44327
|
+
const result = await optimizationResult.result;
|
|
44328
|
+
optimizationResult = undefined;
|
|
43820
44329
|
const scanDeps = Object.keys(result.metadata.optimized);
|
|
43821
44330
|
if (scanDeps.length === 0 && crawlDeps.length === 0) {
|
|
43822
44331
|
debuggerViteDeps(picocolorsExports.green(`✨ no dependencies found by the scanner or crawling static imports`));
|
|
@@ -43984,12 +44493,12 @@ async function optimizeDeps(config, force = config.optimizeDeps.force, asCommand
|
|
|
43984
44493
|
if (cachedMetadata) {
|
|
43985
44494
|
return cachedMetadata;
|
|
43986
44495
|
}
|
|
43987
|
-
const deps = await discoverProjectDependencies(config);
|
|
44496
|
+
const deps = await discoverProjectDependencies(config).result;
|
|
43988
44497
|
const depsString = depsLogString(Object.keys(deps));
|
|
43989
44498
|
log(picocolorsExports.green(`Optimizing dependencies:\n ${depsString}`));
|
|
43990
44499
|
await addManuallyIncludedOptimizeDeps(deps, config, ssr);
|
|
43991
44500
|
const depsInfo = toDiscoveredDependencies(config, deps, ssr);
|
|
43992
|
-
const result = await runOptimizeDeps(config, depsInfo);
|
|
44501
|
+
const result = await runOptimizeDeps(config, depsInfo).result;
|
|
43993
44502
|
await result.commit();
|
|
43994
44503
|
return result.metadata;
|
|
43995
44504
|
}
|
|
@@ -44015,7 +44524,7 @@ async function optimizeServerSsrDeps(config) {
|
|
|
44015
44524
|
const deps = {};
|
|
44016
44525
|
await addManuallyIncludedOptimizeDeps(deps, config, ssr, alsoInclude, noExternalFilter);
|
|
44017
44526
|
const depsInfo = toDiscoveredDependencies(config, deps, true);
|
|
44018
|
-
const result = await runOptimizeDeps(config, depsInfo, true);
|
|
44527
|
+
const result = await runOptimizeDeps(config, depsInfo, true).result;
|
|
44019
44528
|
await result.commit();
|
|
44020
44529
|
return result.metadata;
|
|
44021
44530
|
}
|
|
@@ -44072,15 +44581,20 @@ function loadCachedDepOptimizationMetadata(config, ssr, force = config.optimizeD
|
|
|
44072
44581
|
* Initial optimizeDeps at server start. Perform a fast scan using esbuild to
|
|
44073
44582
|
* find deps to pre-bundle and include user hard-coded dependencies
|
|
44074
44583
|
*/
|
|
44075
|
-
|
|
44076
|
-
const {
|
|
44077
|
-
|
|
44078
|
-
|
|
44079
|
-
|
|
44080
|
-
|
|
44081
|
-
.
|
|
44082
|
-
|
|
44083
|
-
|
|
44584
|
+
function discoverProjectDependencies(config) {
|
|
44585
|
+
const { cancel, result } = scanImports(config);
|
|
44586
|
+
return {
|
|
44587
|
+
cancel,
|
|
44588
|
+
result: result.then(({ deps, missing }) => {
|
|
44589
|
+
const missingIds = Object.keys(missing);
|
|
44590
|
+
if (missingIds.length) {
|
|
44591
|
+
throw new Error(`The following dependencies are imported but could not be resolved:\n\n ${missingIds
|
|
44592
|
+
.map((id) => `${picocolorsExports.cyan(id)} ${picocolorsExports.white(picocolorsExports.dim(`(imported by ${missing[id]})`))}`)
|
|
44593
|
+
.join(`\n `)}\n\nAre they installed?`);
|
|
44594
|
+
}
|
|
44595
|
+
return deps;
|
|
44596
|
+
}),
|
|
44597
|
+
};
|
|
44084
44598
|
}
|
|
44085
44599
|
function toDiscoveredDependencies(config, deps, ssr, timestamp) {
|
|
44086
44600
|
const browserHash = getOptimizedBrowserHash(getDepHash(config, ssr), deps, timestamp);
|
|
@@ -44114,9 +44628,9 @@ function depsLogString(qualifiedIds) {
|
|
|
44114
44628
|
* Internally, Vite uses this function to prepare a optimizeDeps run. When Vite starts, we can get
|
|
44115
44629
|
* the metadata and start the server without waiting for the optimizeDeps processing to be completed
|
|
44116
44630
|
*/
|
|
44117
|
-
|
|
44631
|
+
function runOptimizeDeps(resolvedConfig, depsInfo, ssr = resolvedConfig.command === 'build' &&
|
|
44118
44632
|
!!resolvedConfig.build.ssr) {
|
|
44119
|
-
const
|
|
44633
|
+
const optimizerContext = { cancelled: false };
|
|
44120
44634
|
const config = {
|
|
44121
44635
|
...resolvedConfig,
|
|
44122
44636
|
command: 'build',
|
|
@@ -44141,22 +44655,119 @@ async function runOptimizeDeps(resolvedConfig, depsInfo, ssr = resolvedConfig.co
|
|
|
44141
44655
|
// to wait here. Code that needs to access the cached deps needs to await
|
|
44142
44656
|
// the optimizedDepInfo.processing promise for each dep
|
|
44143
44657
|
const qualifiedIds = Object.keys(depsInfo);
|
|
44144
|
-
|
|
44658
|
+
let cleaned = false;
|
|
44659
|
+
const cleanUp = () => {
|
|
44660
|
+
if (!cleaned) {
|
|
44661
|
+
cleaned = true;
|
|
44662
|
+
fs$l.rmSync(processingCacheDir, { recursive: true, force: true });
|
|
44663
|
+
}
|
|
44664
|
+
};
|
|
44665
|
+
const createProcessingResult = () => ({
|
|
44145
44666
|
metadata,
|
|
44146
44667
|
async commit() {
|
|
44668
|
+
if (cleaned) {
|
|
44669
|
+
throw new Error(`Vite Internal Error: Can't commit optimizeDeps processing result, it has already been cancelled.`);
|
|
44670
|
+
}
|
|
44147
44671
|
// Write metadata file, delete `deps` folder and rename the `processing` folder to `deps`
|
|
44148
44672
|
// Processing is done, we can now replace the depsCacheDir with processingCacheDir
|
|
44149
44673
|
// Rewire the file paths from the temporal processing dir to the final deps cache dir
|
|
44150
44674
|
await removeDir(depsCacheDir);
|
|
44151
44675
|
await renameDir(processingCacheDir, depsCacheDir);
|
|
44152
44676
|
},
|
|
44153
|
-
cancel
|
|
44154
|
-
|
|
44155
|
-
},
|
|
44156
|
-
};
|
|
44677
|
+
cancel: cleanUp,
|
|
44678
|
+
});
|
|
44157
44679
|
if (!qualifiedIds.length) {
|
|
44158
|
-
return
|
|
44680
|
+
return {
|
|
44681
|
+
cancel: async () => cleanUp(),
|
|
44682
|
+
result: Promise.resolve(createProcessingResult()),
|
|
44683
|
+
};
|
|
44159
44684
|
}
|
|
44685
|
+
const start = performance.now();
|
|
44686
|
+
const preparedRun = prepareEsbuildOptimizerRun(resolvedConfig, depsInfo, ssr, processingCacheDir, optimizerContext);
|
|
44687
|
+
const result = preparedRun.then(({ context, idToExports }) => {
|
|
44688
|
+
function disposeContext() {
|
|
44689
|
+
return context?.dispose().catch((e) => {
|
|
44690
|
+
config.logger.error('Failed to dispose esbuild context', { error: e });
|
|
44691
|
+
});
|
|
44692
|
+
}
|
|
44693
|
+
if (!context || optimizerContext.cancelled) {
|
|
44694
|
+
disposeContext();
|
|
44695
|
+
return createProcessingResult();
|
|
44696
|
+
}
|
|
44697
|
+
return context
|
|
44698
|
+
.rebuild()
|
|
44699
|
+
.then((result) => {
|
|
44700
|
+
const meta = result.metafile;
|
|
44701
|
+
// the paths in `meta.outputs` are relative to `process.cwd()`
|
|
44702
|
+
const processingCacheDirOutputPath = path$o.relative(process.cwd(), processingCacheDir);
|
|
44703
|
+
for (const id in depsInfo) {
|
|
44704
|
+
const output = esbuildOutputFromId(meta.outputs, id, processingCacheDir);
|
|
44705
|
+
const { exportsData, ...info } = depsInfo[id];
|
|
44706
|
+
addOptimizedDepInfo(metadata, 'optimized', {
|
|
44707
|
+
...info,
|
|
44708
|
+
// We only need to hash the output.imports in to check for stability, but adding the hash
|
|
44709
|
+
// and file path gives us a unique hash that may be useful for other things in the future
|
|
44710
|
+
fileHash: getHash(metadata.hash +
|
|
44711
|
+
depsInfo[id].file +
|
|
44712
|
+
JSON.stringify(output.imports)),
|
|
44713
|
+
browserHash: metadata.browserHash,
|
|
44714
|
+
// After bundling we have more information and can warn the user about legacy packages
|
|
44715
|
+
// that require manual configuration
|
|
44716
|
+
needsInterop: needsInterop(config, ssr, id, idToExports[id], output),
|
|
44717
|
+
});
|
|
44718
|
+
}
|
|
44719
|
+
for (const o of Object.keys(meta.outputs)) {
|
|
44720
|
+
if (!o.match(jsMapExtensionRE)) {
|
|
44721
|
+
const id = path$o
|
|
44722
|
+
.relative(processingCacheDirOutputPath, o)
|
|
44723
|
+
.replace(jsExtensionRE, '');
|
|
44724
|
+
const file = getOptimizedDepPath(id, resolvedConfig, ssr);
|
|
44725
|
+
if (!findOptimizedDepInfoInRecord(metadata.optimized, (depInfo) => depInfo.file === file)) {
|
|
44726
|
+
addOptimizedDepInfo(metadata, 'chunks', {
|
|
44727
|
+
id,
|
|
44728
|
+
file,
|
|
44729
|
+
needsInterop: false,
|
|
44730
|
+
browserHash: metadata.browserHash,
|
|
44731
|
+
});
|
|
44732
|
+
}
|
|
44733
|
+
}
|
|
44734
|
+
}
|
|
44735
|
+
const dataPath = path$o.join(processingCacheDir, '_metadata.json');
|
|
44736
|
+
writeFile(dataPath, stringifyDepsOptimizerMetadata(metadata, depsCacheDir));
|
|
44737
|
+
debug$7(`deps bundled in ${(performance.now() - start).toFixed(2)}ms`);
|
|
44738
|
+
return createProcessingResult();
|
|
44739
|
+
})
|
|
44740
|
+
.catch((e) => {
|
|
44741
|
+
if (e.errors && e.message.includes('The build was canceled')) {
|
|
44742
|
+
// esbuild logs an error when cancelling, but this is expected so
|
|
44743
|
+
// return an empty result instead
|
|
44744
|
+
return createProcessingResult();
|
|
44745
|
+
}
|
|
44746
|
+
throw e;
|
|
44747
|
+
})
|
|
44748
|
+
.finally(() => {
|
|
44749
|
+
return disposeContext();
|
|
44750
|
+
});
|
|
44751
|
+
});
|
|
44752
|
+
result.catch(() => {
|
|
44753
|
+
cleanUp();
|
|
44754
|
+
});
|
|
44755
|
+
return {
|
|
44756
|
+
async cancel() {
|
|
44757
|
+
optimizerContext.cancelled = true;
|
|
44758
|
+
const { context } = await preparedRun;
|
|
44759
|
+
await context?.cancel();
|
|
44760
|
+
cleanUp();
|
|
44761
|
+
},
|
|
44762
|
+
result,
|
|
44763
|
+
};
|
|
44764
|
+
}
|
|
44765
|
+
async function prepareEsbuildOptimizerRun(resolvedConfig, depsInfo, ssr, processingCacheDir, optimizerContext) {
|
|
44766
|
+
const isBuild = resolvedConfig.command === 'build';
|
|
44767
|
+
const config = {
|
|
44768
|
+
...resolvedConfig,
|
|
44769
|
+
command: 'build',
|
|
44770
|
+
};
|
|
44160
44771
|
// esbuild generates nested directory output with lowest common ancestor base
|
|
44161
44772
|
// this is unpredictable and makes it difficult to analyze entry / output
|
|
44162
44773
|
// mapping. So what we do here is:
|
|
@@ -44183,6 +44794,8 @@ async function runOptimizeDeps(resolvedConfig, depsInfo, ssr = resolvedConfig.co
|
|
|
44183
44794
|
flatIdDeps[flatId] = src;
|
|
44184
44795
|
idToExports[id] = exportsData;
|
|
44185
44796
|
}
|
|
44797
|
+
if (optimizerContext.cancelled)
|
|
44798
|
+
return { context: undefined, idToExports };
|
|
44186
44799
|
// esbuild automatically replaces process.env.NODE_ENV for platform 'browser'
|
|
44187
44800
|
// In lib mode, we need to keep process.env.NODE_ENV untouched, so to at build
|
|
44188
44801
|
// time we replace it by __vite_process_env_NODE_ENV. This placeholder will be
|
|
@@ -44214,8 +44827,7 @@ async function runOptimizeDeps(resolvedConfig, depsInfo, ssr = resolvedConfig.co
|
|
|
44214
44827
|
plugins.push(esbuildCjsExternalPlugin(external, platform));
|
|
44215
44828
|
}
|
|
44216
44829
|
plugins.push(esbuildDepPlugin(flatIdDeps, external, config, ssr));
|
|
44217
|
-
const
|
|
44218
|
-
const result = await build$3({
|
|
44830
|
+
const context = await esbuild.context({
|
|
44219
44831
|
absWorkingDir: process.cwd(),
|
|
44220
44832
|
entryPoints: Object.keys(flatIdDeps),
|
|
44221
44833
|
bundle: true,
|
|
@@ -44248,46 +44860,10 @@ async function runOptimizeDeps(resolvedConfig, depsInfo, ssr = resolvedConfig.co
|
|
|
44248
44860
|
...esbuildOptions.supported,
|
|
44249
44861
|
},
|
|
44250
44862
|
});
|
|
44251
|
-
|
|
44252
|
-
// the paths in `meta.outputs` are relative to `process.cwd()`
|
|
44253
|
-
const processingCacheDirOutputPath = path$o.relative(process.cwd(), processingCacheDir);
|
|
44254
|
-
for (const id in depsInfo) {
|
|
44255
|
-
const output = esbuildOutputFromId(meta.outputs, id, processingCacheDir);
|
|
44256
|
-
const { exportsData, ...info } = depsInfo[id];
|
|
44257
|
-
addOptimizedDepInfo(metadata, 'optimized', {
|
|
44258
|
-
...info,
|
|
44259
|
-
// We only need to hash the output.imports in to check for stability, but adding the hash
|
|
44260
|
-
// and file path gives us a unique hash that may be useful for other things in the future
|
|
44261
|
-
fileHash: getHash(metadata.hash + depsInfo[id].file + JSON.stringify(output.imports)),
|
|
44262
|
-
browserHash: metadata.browserHash,
|
|
44263
|
-
// After bundling we have more information and can warn the user about legacy packages
|
|
44264
|
-
// that require manual configuration
|
|
44265
|
-
needsInterop: needsInterop(config, ssr, id, idToExports[id], output),
|
|
44266
|
-
});
|
|
44267
|
-
}
|
|
44268
|
-
for (const o of Object.keys(meta.outputs)) {
|
|
44269
|
-
if (!o.match(jsMapExtensionRE)) {
|
|
44270
|
-
const id = path$o
|
|
44271
|
-
.relative(processingCacheDirOutputPath, o)
|
|
44272
|
-
.replace(jsExtensionRE, '');
|
|
44273
|
-
const file = getOptimizedDepPath(id, resolvedConfig, ssr);
|
|
44274
|
-
if (!findOptimizedDepInfoInRecord(metadata.optimized, (depInfo) => depInfo.file === file)) {
|
|
44275
|
-
addOptimizedDepInfo(metadata, 'chunks', {
|
|
44276
|
-
id,
|
|
44277
|
-
file,
|
|
44278
|
-
needsInterop: false,
|
|
44279
|
-
browserHash: metadata.browserHash,
|
|
44280
|
-
});
|
|
44281
|
-
}
|
|
44282
|
-
}
|
|
44283
|
-
}
|
|
44284
|
-
const dataPath = path$o.join(processingCacheDir, '_metadata.json');
|
|
44285
|
-
writeFile(dataPath, stringifyDepsOptimizerMetadata(metadata, depsCacheDir));
|
|
44286
|
-
debug$7(`deps bundled in ${(performance.now() - start).toFixed(2)}ms`);
|
|
44287
|
-
return processingResult;
|
|
44863
|
+
return { context, idToExports };
|
|
44288
44864
|
}
|
|
44289
44865
|
async function findKnownImports(config, ssr) {
|
|
44290
|
-
const deps =
|
|
44866
|
+
const { deps } = await scanImports(config).result;
|
|
44291
44867
|
await addManuallyIncludedOptimizeDeps(deps, config, ssr);
|
|
44292
44868
|
return Object.keys(deps);
|
|
44293
44869
|
}
|
|
@@ -44361,7 +44937,10 @@ function getDepsCacheDir(config, ssr) {
|
|
|
44361
44937
|
return getDepsCacheDirPrefix(config) + getDepsCacheSuffix(config, ssr);
|
|
44362
44938
|
}
|
|
44363
44939
|
function getProcessingDepsCacheDir(config, ssr) {
|
|
44364
|
-
return (getDepsCacheDirPrefix(config) +
|
|
44940
|
+
return (getDepsCacheDirPrefix(config) +
|
|
44941
|
+
getDepsCacheSuffix(config, ssr) +
|
|
44942
|
+
'_temp_' +
|
|
44943
|
+
getHash(Date.now().toString()));
|
|
44365
44944
|
}
|
|
44366
44945
|
function getDepsCacheDirPrefix(config) {
|
|
44367
44946
|
return normalizePath$3(path$o.resolve(config.cacheDir, 'deps'));
|
|
@@ -44624,11 +45203,33 @@ async function optimizedDepNeedsInterop(metadata, file, config, ssr) {
|
|
|
44624
45203
|
}
|
|
44625
45204
|
return depInfo?.needsInterop;
|
|
44626
45205
|
}
|
|
45206
|
+
const MAX_TEMP_DIR_AGE_MS = 24 * 60 * 60 * 1000;
|
|
45207
|
+
async function cleanupDepsCacheStaleDirs(config) {
|
|
45208
|
+
try {
|
|
45209
|
+
const cacheDir = path$o.resolve(config.cacheDir);
|
|
45210
|
+
if (fs$l.existsSync(cacheDir)) {
|
|
45211
|
+
const dirents = await fsp.readdir(cacheDir, { withFileTypes: true });
|
|
45212
|
+
for (const dirent of dirents) {
|
|
45213
|
+
if (dirent.isDirectory() && dirent.name.includes('_temp_')) {
|
|
45214
|
+
const tempDirPath = path$o.resolve(config.cacheDir, dirent.name);
|
|
45215
|
+
const { mtime } = await fsp.stat(tempDirPath);
|
|
45216
|
+
if (Date.now() - mtime.getTime() > MAX_TEMP_DIR_AGE_MS) {
|
|
45217
|
+
await removeDir(tempDirPath);
|
|
45218
|
+
}
|
|
45219
|
+
}
|
|
45220
|
+
}
|
|
45221
|
+
}
|
|
45222
|
+
}
|
|
45223
|
+
catch (err) {
|
|
45224
|
+
config.logger.error(err);
|
|
45225
|
+
}
|
|
45226
|
+
}
|
|
44627
45227
|
|
|
44628
45228
|
var index$1 = {
|
|
44629
45229
|
__proto__: null,
|
|
44630
45230
|
addManuallyIncludedOptimizeDeps: addManuallyIncludedOptimizeDeps,
|
|
44631
45231
|
addOptimizedDepInfo: addOptimizedDepInfo,
|
|
45232
|
+
cleanupDepsCacheStaleDirs: cleanupDepsCacheStaleDirs,
|
|
44632
45233
|
createIsOptimizedDepUrl: createIsOptimizedDepUrl,
|
|
44633
45234
|
debuggerViteDeps: debuggerViteDeps,
|
|
44634
45235
|
depsFromOptimizedDepInfo: depsFromOptimizedDepInfo,
|
|
@@ -44907,6 +45508,8 @@ function buildImportAnalysisPlugin(config) {
|
|
|
44907
45508
|
(source.slice(expStart, start).includes('from') || isDynamicImport) &&
|
|
44908
45509
|
// already has ?used query (by import.meta.glob)
|
|
44909
45510
|
!specifier.match(/\?used(&|$)/) &&
|
|
45511
|
+
// don't append ?used when SPECIAL_QUERY_RE exists
|
|
45512
|
+
!specifier.match(SPECIAL_QUERY_RE) &&
|
|
44910
45513
|
// edge case for package names ending with .css (e.g normalize.css)
|
|
44911
45514
|
!(bareImportRE.test(specifier) && !specifier.includes('/'))) {
|
|
44912
45515
|
const url = specifier.replace(/\?|$/, (m) => `?used${m ? '&' : ''}`);
|
|
@@ -45326,323 +45929,7 @@ function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
|
|
45326
45929
|
return searchForWorkspaceRoot(dir, root);
|
|
45327
45930
|
}
|
|
45328
45931
|
|
|
45329
|
-
|
|
45330
|
-
var main$1 = {
|
|
45331
|
-
get exports(){ return mainExports; },
|
|
45332
|
-
set exports(v){ mainExports = v; },
|
|
45333
|
-
};
|
|
45334
|
-
|
|
45335
|
-
var name = "dotenv";
|
|
45336
|
-
var version$1 = "16.0.3";
|
|
45337
|
-
var description = "Loads environment variables from .env file";
|
|
45338
|
-
var main = "lib/main.js";
|
|
45339
|
-
var types = "lib/main.d.ts";
|
|
45340
|
-
var exports = {
|
|
45341
|
-
".": {
|
|
45342
|
-
require: "./lib/main.js",
|
|
45343
|
-
types: "./lib/main.d.ts",
|
|
45344
|
-
"default": "./lib/main.js"
|
|
45345
|
-
},
|
|
45346
|
-
"./config": "./config.js",
|
|
45347
|
-
"./config.js": "./config.js",
|
|
45348
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
45349
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
45350
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
45351
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
45352
|
-
"./package.json": "./package.json"
|
|
45353
|
-
};
|
|
45354
|
-
var scripts = {
|
|
45355
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
45356
|
-
lint: "standard",
|
|
45357
|
-
"lint-readme": "standard-markdown",
|
|
45358
|
-
pretest: "npm run lint && npm run dts-check",
|
|
45359
|
-
test: "tap tests/*.js --100 -Rspec",
|
|
45360
|
-
prerelease: "npm test",
|
|
45361
|
-
release: "standard-version"
|
|
45362
|
-
};
|
|
45363
|
-
var repository = {
|
|
45364
|
-
type: "git",
|
|
45365
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
45366
|
-
};
|
|
45367
|
-
var keywords = [
|
|
45368
|
-
"dotenv",
|
|
45369
|
-
"env",
|
|
45370
|
-
".env",
|
|
45371
|
-
"environment",
|
|
45372
|
-
"variables",
|
|
45373
|
-
"config",
|
|
45374
|
-
"settings"
|
|
45375
|
-
];
|
|
45376
|
-
var readmeFilename = "README.md";
|
|
45377
|
-
var license = "BSD-2-Clause";
|
|
45378
|
-
var devDependencies = {
|
|
45379
|
-
"@types/node": "^17.0.9",
|
|
45380
|
-
decache: "^4.6.1",
|
|
45381
|
-
dtslint: "^3.7.0",
|
|
45382
|
-
sinon: "^12.0.1",
|
|
45383
|
-
standard: "^16.0.4",
|
|
45384
|
-
"standard-markdown": "^7.1.0",
|
|
45385
|
-
"standard-version": "^9.3.2",
|
|
45386
|
-
tap: "^15.1.6",
|
|
45387
|
-
tar: "^6.1.11",
|
|
45388
|
-
typescript: "^4.5.4"
|
|
45389
|
-
};
|
|
45390
|
-
var engines = {
|
|
45391
|
-
node: ">=12"
|
|
45392
|
-
};
|
|
45393
|
-
var require$$3 = {
|
|
45394
|
-
name: name,
|
|
45395
|
-
version: version$1,
|
|
45396
|
-
description: description,
|
|
45397
|
-
main: main,
|
|
45398
|
-
types: types,
|
|
45399
|
-
exports: exports,
|
|
45400
|
-
scripts: scripts,
|
|
45401
|
-
repository: repository,
|
|
45402
|
-
keywords: keywords,
|
|
45403
|
-
readmeFilename: readmeFilename,
|
|
45404
|
-
license: license,
|
|
45405
|
-
devDependencies: devDependencies,
|
|
45406
|
-
engines: engines
|
|
45407
|
-
};
|
|
45408
|
-
|
|
45409
|
-
const fs$9 = require$$0__default;
|
|
45410
|
-
const path$9 = require$$0$4;
|
|
45411
|
-
const os$2 = require$$2;
|
|
45412
|
-
const packageJson = require$$3;
|
|
45413
|
-
|
|
45414
|
-
const version = packageJson.version;
|
|
45415
|
-
|
|
45416
|
-
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
45417
|
-
|
|
45418
|
-
// Parser src into an Object
|
|
45419
|
-
function parse$8 (src) {
|
|
45420
|
-
const obj = {};
|
|
45421
|
-
|
|
45422
|
-
// Convert buffer to string
|
|
45423
|
-
let lines = src.toString();
|
|
45424
|
-
|
|
45425
|
-
// Convert line breaks to same format
|
|
45426
|
-
lines = lines.replace(/\r\n?/mg, '\n');
|
|
45427
|
-
|
|
45428
|
-
let match;
|
|
45429
|
-
while ((match = LINE.exec(lines)) != null) {
|
|
45430
|
-
const key = match[1];
|
|
45431
|
-
|
|
45432
|
-
// Default undefined or null to empty string
|
|
45433
|
-
let value = (match[2] || '');
|
|
45434
|
-
|
|
45435
|
-
// Remove whitespace
|
|
45436
|
-
value = value.trim();
|
|
45437
|
-
|
|
45438
|
-
// Check if double quoted
|
|
45439
|
-
const maybeQuote = value[0];
|
|
45440
|
-
|
|
45441
|
-
// Remove surrounding quotes
|
|
45442
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2');
|
|
45443
|
-
|
|
45444
|
-
// Expand newlines if double quoted
|
|
45445
|
-
if (maybeQuote === '"') {
|
|
45446
|
-
value = value.replace(/\\n/g, '\n');
|
|
45447
|
-
value = value.replace(/\\r/g, '\r');
|
|
45448
|
-
}
|
|
45449
|
-
|
|
45450
|
-
// Add to object
|
|
45451
|
-
obj[key] = value;
|
|
45452
|
-
}
|
|
45453
|
-
|
|
45454
|
-
return obj
|
|
45455
|
-
}
|
|
45456
|
-
|
|
45457
|
-
function _log (message) {
|
|
45458
|
-
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
45459
|
-
}
|
|
45460
|
-
|
|
45461
|
-
function _resolveHome (envPath) {
|
|
45462
|
-
return envPath[0] === '~' ? path$9.join(os$2.homedir(), envPath.slice(1)) : envPath
|
|
45463
|
-
}
|
|
45464
|
-
|
|
45465
|
-
// Populates process.env from .env file
|
|
45466
|
-
function config (options) {
|
|
45467
|
-
let dotenvPath = path$9.resolve(process.cwd(), '.env');
|
|
45468
|
-
let encoding = 'utf8';
|
|
45469
|
-
const debug = Boolean(options && options.debug);
|
|
45470
|
-
const override = Boolean(options && options.override);
|
|
45471
|
-
|
|
45472
|
-
if (options) {
|
|
45473
|
-
if (options.path != null) {
|
|
45474
|
-
dotenvPath = _resolveHome(options.path);
|
|
45475
|
-
}
|
|
45476
|
-
if (options.encoding != null) {
|
|
45477
|
-
encoding = options.encoding;
|
|
45478
|
-
}
|
|
45479
|
-
}
|
|
45480
|
-
|
|
45481
|
-
try {
|
|
45482
|
-
// Specifying an encoding returns a string instead of a buffer
|
|
45483
|
-
const parsed = DotenvModule.parse(fs$9.readFileSync(dotenvPath, { encoding }));
|
|
45484
|
-
|
|
45485
|
-
Object.keys(parsed).forEach(function (key) {
|
|
45486
|
-
if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
|
|
45487
|
-
process.env[key] = parsed[key];
|
|
45488
|
-
} else {
|
|
45489
|
-
if (override === true) {
|
|
45490
|
-
process.env[key] = parsed[key];
|
|
45491
|
-
}
|
|
45492
|
-
|
|
45493
|
-
if (debug) {
|
|
45494
|
-
if (override === true) {
|
|
45495
|
-
_log(`"${key}" is already defined in \`process.env\` and WAS overwritten`);
|
|
45496
|
-
} else {
|
|
45497
|
-
_log(`"${key}" is already defined in \`process.env\` and was NOT overwritten`);
|
|
45498
|
-
}
|
|
45499
|
-
}
|
|
45500
|
-
}
|
|
45501
|
-
});
|
|
45502
|
-
|
|
45503
|
-
return { parsed }
|
|
45504
|
-
} catch (e) {
|
|
45505
|
-
if (debug) {
|
|
45506
|
-
_log(`Failed to load ${dotenvPath} ${e.message}`);
|
|
45507
|
-
}
|
|
45508
|
-
|
|
45509
|
-
return { error: e }
|
|
45510
|
-
}
|
|
45511
|
-
}
|
|
45512
|
-
|
|
45513
|
-
const DotenvModule = {
|
|
45514
|
-
config,
|
|
45515
|
-
parse: parse$8
|
|
45516
|
-
};
|
|
45517
|
-
|
|
45518
|
-
mainExports.config = DotenvModule.config;
|
|
45519
|
-
var parse_1$1 = mainExports.parse = DotenvModule.parse;
|
|
45520
|
-
main$1.exports = DotenvModule;
|
|
45521
|
-
|
|
45522
|
-
function _interpolate (envValue, environment, config) {
|
|
45523
|
-
const matches = envValue.match(/(.?\${*[\w]*(?::-[\w/]*)?}*)/g) || [];
|
|
45524
|
-
|
|
45525
|
-
return matches.reduce(function (newEnv, match, index) {
|
|
45526
|
-
const parts = /(.?)\${*([\w]*(?::-[\w/]*)?)?}*/g.exec(match);
|
|
45527
|
-
if (!parts || parts.length === 0) {
|
|
45528
|
-
return newEnv
|
|
45529
|
-
}
|
|
45530
|
-
|
|
45531
|
-
const prefix = parts[1];
|
|
45532
|
-
|
|
45533
|
-
let value, replacePart;
|
|
45534
|
-
|
|
45535
|
-
if (prefix === '\\') {
|
|
45536
|
-
replacePart = parts[0];
|
|
45537
|
-
value = replacePart.replace('\\$', '$');
|
|
45538
|
-
} else {
|
|
45539
|
-
// PATCH: compatible with env variables ended with unescaped $
|
|
45540
|
-
if(!parts[2]) {
|
|
45541
|
-
return newEnv
|
|
45542
|
-
}
|
|
45543
|
-
const keyParts = parts[2].split(':-');
|
|
45544
|
-
const key = keyParts[0];
|
|
45545
|
-
replacePart = parts[0].substring(prefix.length);
|
|
45546
|
-
// process.env value 'wins' over .env file's value
|
|
45547
|
-
value = Object.prototype.hasOwnProperty.call(environment, key)
|
|
45548
|
-
? environment[key]
|
|
45549
|
-
: (config.parsed[key] || keyParts[1] || '');
|
|
45550
|
-
|
|
45551
|
-
// If the value is found, remove nested expansions.
|
|
45552
|
-
if (keyParts.length > 1 && value) {
|
|
45553
|
-
const replaceNested = matches[index + 1];
|
|
45554
|
-
matches[index + 1] = '';
|
|
45555
|
-
|
|
45556
|
-
newEnv = newEnv.replace(replaceNested, '');
|
|
45557
|
-
}
|
|
45558
|
-
// Resolve recursive interpolations
|
|
45559
|
-
value = _interpolate(value, environment, config);
|
|
45560
|
-
}
|
|
45561
|
-
|
|
45562
|
-
return newEnv.replace(replacePart, value)
|
|
45563
|
-
}, envValue)
|
|
45564
|
-
}
|
|
45565
|
-
|
|
45566
|
-
function expand (config) {
|
|
45567
|
-
// if ignoring process.env, use a blank object
|
|
45568
|
-
const environment = config.ignoreProcessEnv ? {} : process.env;
|
|
45569
|
-
|
|
45570
|
-
for (const configKey in config.parsed) {
|
|
45571
|
-
const value = Object.prototype.hasOwnProperty.call(environment, configKey) ? environment[configKey] : config.parsed[configKey];
|
|
45572
|
-
|
|
45573
|
-
config.parsed[configKey] = _interpolate(value, environment, config);
|
|
45574
|
-
}
|
|
45575
|
-
|
|
45576
|
-
// PATCH: don't write to process.env
|
|
45577
|
-
// for (const processKey in config.parsed) {
|
|
45578
|
-
// environment[processKey] = config.parsed[processKey]
|
|
45579
|
-
// }
|
|
45580
|
-
|
|
45581
|
-
return config
|
|
45582
|
-
}
|
|
45583
|
-
|
|
45584
|
-
var expand_1 = expand;
|
|
45585
|
-
|
|
45586
|
-
function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
45587
|
-
if (mode === 'local') {
|
|
45588
|
-
throw new Error(`"local" cannot be used as a mode name because it conflicts with ` +
|
|
45589
|
-
`the .local postfix for .env files.`);
|
|
45590
|
-
}
|
|
45591
|
-
prefixes = arraify(prefixes);
|
|
45592
|
-
const env = {};
|
|
45593
|
-
const envFiles = [
|
|
45594
|
-
/** default file */ `.env`,
|
|
45595
|
-
/** local file */ `.env.local`,
|
|
45596
|
-
/** mode file */ `.env.${mode}`,
|
|
45597
|
-
/** mode local file */ `.env.${mode}.local`,
|
|
45598
|
-
];
|
|
45599
|
-
const parsed = Object.fromEntries(envFiles.flatMap((file) => {
|
|
45600
|
-
const path = lookupFile(envDir, [file], {
|
|
45601
|
-
pathOnly: true,
|
|
45602
|
-
rootDir: envDir,
|
|
45603
|
-
});
|
|
45604
|
-
if (!path)
|
|
45605
|
-
return [];
|
|
45606
|
-
return Object.entries(parse_1$1(fs$l.readFileSync(path)));
|
|
45607
|
-
}));
|
|
45608
|
-
// test NODE_ENV override before expand as otherwise process.env.NODE_ENV would override this
|
|
45609
|
-
if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) {
|
|
45610
|
-
process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV;
|
|
45611
|
-
}
|
|
45612
|
-
// support BROWSER and BROWSER_ARGS env variables
|
|
45613
|
-
if (parsed.BROWSER && process.env.BROWSER === undefined) {
|
|
45614
|
-
process.env.BROWSER = parsed.BROWSER;
|
|
45615
|
-
}
|
|
45616
|
-
if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === undefined) {
|
|
45617
|
-
process.env.BROWSER_ARGS = parsed.BROWSER_ARGS;
|
|
45618
|
-
}
|
|
45619
|
-
// let environment variables use each other
|
|
45620
|
-
// `expand` patched in patches/dotenv-expand@9.0.0.patch
|
|
45621
|
-
expand_1({ parsed });
|
|
45622
|
-
// only keys that start with prefix are exposed to client
|
|
45623
|
-
for (const [key, value] of Object.entries(parsed)) {
|
|
45624
|
-
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
45625
|
-
env[key] = value;
|
|
45626
|
-
}
|
|
45627
|
-
}
|
|
45628
|
-
// check if there are actual env variables starting with VITE_*
|
|
45629
|
-
// these are typically provided inline and should be prioritized
|
|
45630
|
-
for (const key in process.env) {
|
|
45631
|
-
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
45632
|
-
env[key] = process.env[key];
|
|
45633
|
-
}
|
|
45634
|
-
}
|
|
45635
|
-
return env;
|
|
45636
|
-
}
|
|
45637
|
-
function resolveEnvPrefix({ envPrefix = 'VITE_', }) {
|
|
45638
|
-
envPrefix = arraify(envPrefix);
|
|
45639
|
-
if (envPrefix.some((prefix) => prefix === '')) {
|
|
45640
|
-
throw new Error(`envPrefix option contains value '', which could lead unexpected exposure of sensitive information.`);
|
|
45641
|
-
}
|
|
45642
|
-
return envPrefix;
|
|
45643
|
-
}
|
|
45644
|
-
|
|
45645
|
-
function resolveBuildOptions(raw, logger) {
|
|
45932
|
+
function resolveBuildOptions(raw, logger, root) {
|
|
45646
45933
|
const deprecatedPolyfillModulePreload = raw?.polyfillModulePreload;
|
|
45647
45934
|
if (raw) {
|
|
45648
45935
|
const { polyfillModulePreload, ...rest } = raw;
|
|
@@ -45713,8 +46000,16 @@ function resolveBuildOptions(raw, logger) {
|
|
|
45713
46000
|
resolved.target = ESBUILD_MODULES_TARGET;
|
|
45714
46001
|
}
|
|
45715
46002
|
else if (resolved.target === 'esnext' && resolved.minify === 'terser') {
|
|
45716
|
-
|
|
45717
|
-
|
|
46003
|
+
try {
|
|
46004
|
+
const terserPackageJsonPath = requireResolveFromRootWithFallback(root, 'terser/package.json');
|
|
46005
|
+
const terserPackageJson = JSON.parse(fs$l.readFileSync(terserPackageJsonPath, 'utf-8'));
|
|
46006
|
+
const v = terserPackageJson.version.split('.');
|
|
46007
|
+
if (v[0] === '5' && v[1] < 16) {
|
|
46008
|
+
// esnext + terser 5.16<: limit to es2021 so it can be minified by terser
|
|
46009
|
+
resolved.target = 'es2021';
|
|
46010
|
+
}
|
|
46011
|
+
}
|
|
46012
|
+
catch { }
|
|
45718
46013
|
}
|
|
45719
46014
|
if (!resolved.cssTarget) {
|
|
45720
46015
|
resolved.cssTarget = resolved.target;
|
|
@@ -45726,6 +46021,9 @@ function resolveBuildOptions(raw, logger) {
|
|
|
45726
46021
|
if (resolved.minify === true) {
|
|
45727
46022
|
resolved.minify = 'esbuild';
|
|
45728
46023
|
}
|
|
46024
|
+
if (resolved.cssMinify == null) {
|
|
46025
|
+
resolved.cssMinify = !!resolved.minify;
|
|
46026
|
+
}
|
|
45729
46027
|
return resolved;
|
|
45730
46028
|
}
|
|
45731
46029
|
async function resolveBuildPlugins(config) {
|
|
@@ -53675,12 +53973,14 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
|
|
|
53675
53973
|
mod.ssrError = e;
|
|
53676
53974
|
if (e.stack && fixStacktrace) {
|
|
53677
53975
|
ssrFixStacktrace(e, moduleGraph);
|
|
53678
|
-
server.config.logger.error(`Error when evaluating SSR module ${url}:\n${e.stack}`, {
|
|
53679
|
-
timestamp: true,
|
|
53680
|
-
clear: server.config.clearScreen,
|
|
53681
|
-
error: e,
|
|
53682
|
-
});
|
|
53683
53976
|
}
|
|
53977
|
+
server.config.logger.error(picocolorsExports.red(`Error when evaluating SSR module ${url}:` +
|
|
53978
|
+
(e.importee ? ` failed to import "${e.importee}"\n` : '\n')), {
|
|
53979
|
+
timestamp: true,
|
|
53980
|
+
clear: server.config.clearScreen,
|
|
53981
|
+
error: e,
|
|
53982
|
+
});
|
|
53983
|
+
delete e.importee;
|
|
53684
53984
|
throw e;
|
|
53685
53985
|
}
|
|
53686
53986
|
return Object.freeze(ssrModule);
|
|
@@ -53713,7 +54013,11 @@ async function nodeImport(id, importer, resolveOptions) {
|
|
|
53713
54013
|
const mod = await dynamicImport(url);
|
|
53714
54014
|
return proxyESM(mod);
|
|
53715
54015
|
}
|
|
53716
|
-
catch {
|
|
54016
|
+
catch (err) {
|
|
54017
|
+
// tell external error handler which mod was imported with error
|
|
54018
|
+
err.importee = id;
|
|
54019
|
+
throw err;
|
|
54020
|
+
}
|
|
53717
54021
|
}
|
|
53718
54022
|
// rollup-style default import interop for cjs
|
|
53719
54023
|
function proxyESM(mod) {
|
|
@@ -59209,7 +59513,7 @@ var debug_1 = function () {
|
|
|
59209
59513
|
if (!debug$3) {
|
|
59210
59514
|
try {
|
|
59211
59515
|
/* eslint global-require: off */
|
|
59212
|
-
debug$3 =
|
|
59516
|
+
debug$3 = srcExports$1("follow-redirects");
|
|
59213
59517
|
}
|
|
59214
59518
|
catch (error) { /* */ }
|
|
59215
59519
|
if (typeof debug$3 !== "function") {
|
|
@@ -60455,6 +60759,9 @@ function proxyMiddleware(httpServer, options, config) {
|
|
|
60455
60759
|
opts = { target: opts, changeOrigin: true };
|
|
60456
60760
|
}
|
|
60457
60761
|
const proxy = httpProxy.createProxyServer(opts);
|
|
60762
|
+
if (opts.configure) {
|
|
60763
|
+
opts.configure(proxy, opts);
|
|
60764
|
+
}
|
|
60458
60765
|
proxy.on('error', (err, req, originalRes) => {
|
|
60459
60766
|
// When it is ws proxy, res is net.Socket
|
|
60460
60767
|
const res = originalRes;
|
|
@@ -60479,9 +60786,6 @@ function proxyMiddleware(httpServer, options, config) {
|
|
|
60479
60786
|
res.end();
|
|
60480
60787
|
}
|
|
60481
60788
|
});
|
|
60482
|
-
if (opts.configure) {
|
|
60483
|
-
opts.configure(proxy, opts);
|
|
60484
|
-
}
|
|
60485
60789
|
// clone before saving because http-proxy mutates the options
|
|
60486
60790
|
proxies[context] = [proxy, { ...opts }];
|
|
60487
60791
|
});
|
|
@@ -60868,6 +61172,7 @@ function createDevHtmlTransformFn(server) {
|
|
|
60868
61172
|
return applyHtmlTransforms(html, [
|
|
60869
61173
|
preImportMapHook(server.config),
|
|
60870
61174
|
...preHooks,
|
|
61175
|
+
htmlEnvHook(server.config),
|
|
60871
61176
|
devHtmlHook,
|
|
60872
61177
|
...normalHooks,
|
|
60873
61178
|
...postHooks,
|
|
@@ -62432,7 +62737,9 @@ async function createServer(inlineConfig = {}) {
|
|
|
62432
62737
|
if (httpServer) {
|
|
62433
62738
|
setClientErrorHandler(httpServer, config.logger);
|
|
62434
62739
|
}
|
|
62435
|
-
const watcher = chokidar.watch(
|
|
62740
|
+
const watcher = chokidar.watch(
|
|
62741
|
+
// config file dependencies and env file might be outside of root
|
|
62742
|
+
[root, ...config.configFileDependencies, config.envDir], resolvedWatchOptions);
|
|
62436
62743
|
const moduleGraph = new ModuleGraph((url, ssr) => container.resolveId(url, undefined, { ssr }));
|
|
62437
62744
|
const container = await createPluginContainer(config, moduleGraph, watcher);
|
|
62438
62745
|
const closeHttpServer = createServerCloseFn(httpServer);
|
|
@@ -62701,6 +63008,9 @@ async function createServer(inlineConfig = {}) {
|
|
|
62701
63008
|
else {
|
|
62702
63009
|
await initServer();
|
|
62703
63010
|
}
|
|
63011
|
+
// Fire a clean up of stale cache dirs, in case old processes didn't
|
|
63012
|
+
// terminate correctly. Don't await this promise
|
|
63013
|
+
cleanupDepsCacheStaleDirs(config);
|
|
62704
63014
|
return server;
|
|
62705
63015
|
}
|
|
62706
63016
|
async function startServer(server, inlinePort) {
|
|
@@ -62757,6 +63067,10 @@ function resolveServerOptions(root, raw, logger) {
|
|
|
62757
63067
|
const server = {
|
|
62758
63068
|
preTransformRequests: true,
|
|
62759
63069
|
...raw,
|
|
63070
|
+
sourcemapIgnoreList: raw?.sourcemapIgnoreList === false
|
|
63071
|
+
? () => false
|
|
63072
|
+
: raw?.sourcemapIgnoreList ||
|
|
63073
|
+
((sourcePath) => sourcePath.includes('node_modules')),
|
|
62760
63074
|
middlewareMode: !!raw?.middlewareMode,
|
|
62761
63075
|
};
|
|
62762
63076
|
let allowDirs = server.fs?.allow;
|
|
@@ -62785,6 +63099,7 @@ async function restartServer(server) {
|
|
|
62785
63099
|
global.__vite_start_time = performance.now();
|
|
62786
63100
|
const { port: prevPort, host: prevHost } = server.config.server;
|
|
62787
63101
|
const shortcutsOptions = server._shortcutsOptions;
|
|
63102
|
+
const oldUrls = server.resolvedUrls;
|
|
62788
63103
|
await server.close();
|
|
62789
63104
|
let inlineConfig = server.config.inlineConfig;
|
|
62790
63105
|
if (server._forceOptimizeOnRestart) {
|
|
@@ -62812,7 +63127,8 @@ async function restartServer(server) {
|
|
|
62812
63127
|
await server.listen(port, true);
|
|
62813
63128
|
logger.info('server restarted.', { timestamp: true });
|
|
62814
63129
|
if ((port ?? DEFAULT_DEV_PORT) !== (prevPort ?? DEFAULT_DEV_PORT) ||
|
|
62815
|
-
host !== prevHost
|
|
63130
|
+
host !== prevHost ||
|
|
63131
|
+
diffDnsOrderChange(oldUrls, newServer.resolvedUrls)) {
|
|
62816
63132
|
logger.info('');
|
|
62817
63133
|
server.printUrls();
|
|
62818
63134
|
}
|
|
@@ -63215,7 +63531,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
|
|
63215
63531
|
? '/'
|
|
63216
63532
|
: './'
|
|
63217
63533
|
: resolveBaseUrl(config.base, isBuild, logger) ?? '/';
|
|
63218
|
-
const resolvedBuildOptions = resolveBuildOptions(config.build, logger);
|
|
63534
|
+
const resolvedBuildOptions = resolveBuildOptions(config.build, logger, resolvedRoot);
|
|
63219
63535
|
// resolve cache directory
|
|
63220
63536
|
const pkgPath = lookupFile(resolvedRoot, [`package.json`], { pathOnly: true });
|
|
63221
63537
|
const cacheDir = normalizePath$3(config.cacheDir
|
|
@@ -63312,9 +63628,16 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
|
|
63312
63628
|
mainConfig: null,
|
|
63313
63629
|
isProduction,
|
|
63314
63630
|
plugins: userPlugins,
|
|
63631
|
+
esbuild: config.esbuild === false
|
|
63632
|
+
? false
|
|
63633
|
+
: {
|
|
63634
|
+
jsxDev: !isProduction,
|
|
63635
|
+
...config.esbuild,
|
|
63636
|
+
},
|
|
63315
63637
|
server,
|
|
63316
63638
|
build: resolvedBuildOptions,
|
|
63317
63639
|
preview: resolvePreviewOptions(config.preview, server),
|
|
63640
|
+
envDir,
|
|
63318
63641
|
env: {
|
|
63319
63642
|
...userEnv,
|
|
63320
63643
|
BASE_URL,
|