vite 7.0.4 → 7.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +2 -2
- package/dist/client/client.mjs +7 -6
- package/dist/node/chunks/{dep-DZ2tZksn.js → dep-Bg4HVnP5.js} +124 -89
- package/dist/node/chunks/{dep-DFHPNLee.js → dep-Bkky1B58.js} +1 -1
- package/dist/node/chunks/{dep-C8ByWFY_.js → dep-DPmIzJpk.js} +1 -1
- package/dist/node/chunks/{dep-DDxIcCnt.js → dep-Dunozww-.js} +1 -1
- package/dist/node/chunks/{dep-JtmpCfr0.js → dep-EUZWNfwr.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/index.js +1 -1
- package/dist/node/module-runner.js +24 -83
- package/package.json +6 -6
package/LICENSE.md
CHANGED
@@ -509,10 +509,10 @@ Repository: jonschlinkert/is-number
|
|
509
509
|
|
510
510
|
---------------------------------------
|
511
511
|
|
512
|
-
## bundle-name, default-browser, default-browser-id, define-lazy-prop, is-docker, is-inside-container, is-wsl, open, run-applescript
|
512
|
+
## bundle-name, default-browser, default-browser-id, define-lazy-prop, is-docker, is-inside-container, is-wsl, open, run-applescript, wsl-utils
|
513
513
|
License: MIT
|
514
514
|
By: Sindre Sorhus
|
515
|
-
Repositories: sindresorhus/bundle-name, sindresorhus/default-browser, sindresorhus/default-browser-id, sindresorhus/define-lazy-prop, sindresorhus/is-docker, sindresorhus/is-inside-container, sindresorhus/is-wsl, sindresorhus/open, sindresorhus/run-applescript
|
515
|
+
Repositories: sindresorhus/bundle-name, sindresorhus/default-browser, sindresorhus/default-browser-id, sindresorhus/define-lazy-prop, sindresorhus/is-docker, sindresorhus/is-inside-container, sindresorhus/is-wsl, sindresorhus/open, sindresorhus/run-applescript, sindresorhus/wsl-utils
|
516
516
|
|
517
517
|
> MIT License
|
518
518
|
>
|
package/dist/client/client.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import "@vite/env";
|
2
2
|
|
3
|
-
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.
|
3
|
+
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.77.0/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js
|
4
4
|
function _typeof(o) {
|
5
5
|
"@babel/helpers - typeof";
|
6
6
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
@@ -11,7 +11,7 @@ function _typeof(o) {
|
|
11
11
|
}
|
12
12
|
|
13
13
|
//#endregion
|
14
|
-
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.
|
14
|
+
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.77.0/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js
|
15
15
|
function toPrimitive(t, r) {
|
16
16
|
if ("object" != _typeof(t) || !t) return t;
|
17
17
|
var e = t[Symbol.toPrimitive];
|
@@ -24,14 +24,14 @@ function toPrimitive(t, r) {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
//#endregion
|
27
|
-
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.
|
27
|
+
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.77.0/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js
|
28
28
|
function toPropertyKey(t) {
|
29
29
|
var i = toPrimitive(t, "string");
|
30
30
|
return "symbol" == _typeof(i) ? i : i + "";
|
31
31
|
}
|
32
32
|
|
33
33
|
//#endregion
|
34
|
-
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.
|
34
|
+
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.77.0/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js
|
35
35
|
function _defineProperty(e, r, t) {
|
36
36
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
37
37
|
value: t,
|
@@ -811,8 +811,9 @@ const hmrClient = new HMRClient({
|
|
811
811
|
}, transport, async function importUpdatedModule({ acceptedPath, timestamp, explicitImportRequired, isWithinCircularImport }) {
|
812
812
|
const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`);
|
813
813
|
const importPromise = import(
|
814
|
-
|
815
|
-
|
814
|
+
/* @vite-ignore */
|
815
|
+
base + acceptedPathWithoutQuery.slice(1) + `?${explicitImportRequired ? "import&" : ""}t=${timestamp}${query ? `&${query}` : ""}`
|
816
|
+
);
|
816
817
|
if (isWithinCircularImport) importPromise.catch(() => {
|
817
818
|
console.info(`[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.`);
|
818
819
|
pageReload();
|
@@ -8,7 +8,7 @@ import fs, { existsSync, promises, readFileSync } from "node:fs";
|
|
8
8
|
import path, { basename, dirname, extname, isAbsolute, join, normalize, posix, relative, resolve } from "node:path";
|
9
9
|
import fsp, { constants } from "node:fs/promises";
|
10
10
|
import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
|
11
|
-
import
|
11
|
+
import { format, inspect, promisify, stripVTControlCharacters } from "node:util";
|
12
12
|
import { performance as performance$1 } from "node:perf_hooks";
|
13
13
|
import crypto from "node:crypto";
|
14
14
|
import picomatch from "picomatch";
|
@@ -1387,7 +1387,7 @@ var require_node$1 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.1/node_mod
|
|
1387
1387
|
* Module dependencies.
|
1388
1388
|
*/
|
1389
1389
|
const tty$1 = require("tty");
|
1390
|
-
const util$
|
1390
|
+
const util$2 = require("util");
|
1391
1391
|
/**
|
1392
1392
|
* This is the Node.js implementation of `debug()`.
|
1393
1393
|
*/
|
@@ -1397,7 +1397,7 @@ var require_node$1 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.1/node_mod
|
|
1397
1397
|
exports.save = save$1;
|
1398
1398
|
exports.load = load$2;
|
1399
1399
|
exports.useColors = useColors$1;
|
1400
|
-
exports.destroy = util$
|
1400
|
+
exports.destroy = util$2.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
1401
1401
|
/**
|
1402
1402
|
* Colors.
|
1403
1403
|
*/
|
@@ -1538,7 +1538,7 @@ var require_node$1 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.1/node_mod
|
|
1538
1538
|
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
|
1539
1539
|
*/
|
1540
1540
|
function log$1(...args) {
|
1541
|
-
return process.stderr.write(util$
|
1541
|
+
return process.stderr.write(util$2.formatWithOptions(exports.inspectOpts, ...args) + "\n");
|
1542
1542
|
}
|
1543
1543
|
/**
|
1544
1544
|
* Save `namespaces`.
|
@@ -1577,14 +1577,14 @@ var require_node$1 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.1/node_mod
|
|
1577
1577
|
*/
|
1578
1578
|
formatters.o = function(v) {
|
1579
1579
|
this.inspectOpts.colors = this.useColors;
|
1580
|
-
return util$
|
1580
|
+
return util$2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
1581
1581
|
};
|
1582
1582
|
/**
|
1583
1583
|
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
1584
1584
|
*/
|
1585
1585
|
formatters.O = function(v) {
|
1586
1586
|
this.inspectOpts.colors = this.useColors;
|
1587
|
-
return util$
|
1587
|
+
return util$2.inspect(v, this.inspectOpts);
|
1588
1588
|
};
|
1589
1589
|
} });
|
1590
1590
|
|
@@ -4088,7 +4088,7 @@ var MagicString = class MagicString {
|
|
4088
4088
|
var require_is_reference = __commonJS({ "../../node_modules/.pnpm/is-reference@1.2.1/node_modules/is-reference/dist/is-reference.js"(exports, module) {
|
4089
4089
|
(function(global$1, factory) {
|
4090
4090
|
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global$1 = global$1 || self, global$1.isReference = factory());
|
4091
|
-
})(
|
4091
|
+
})(exports, function() {
|
4092
4092
|
"use strict";
|
4093
4093
|
function isReference$1(node, parent) {
|
4094
4094
|
if (node.type === "MemberExpression") return !node.computed && isReference$1(node.object, node);
|
@@ -7630,7 +7630,7 @@ function checkPublicFile(url$6, config$2) {
|
|
7630
7630
|
if (publicFiles) return publicFiles.has(fileName) ? normalizePath(path.join(publicDir, fileName)) : void 0;
|
7631
7631
|
const publicFile = normalizePath(path.join(publicDir, fileName));
|
7632
7632
|
if (!publicFile.startsWith(withTrailingSlash(publicDir))) return;
|
7633
|
-
return
|
7633
|
+
return tryStatSync(publicFile)?.isFile() ? publicFile : void 0;
|
7634
7634
|
}
|
7635
7635
|
|
7636
7636
|
//#endregion
|
@@ -7640,7 +7640,6 @@ const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g;
|
|
7640
7640
|
const jsSourceMapRE = /\.[cm]?js\.map$/;
|
7641
7641
|
const noInlineRE = /[?&]no-inline\b/;
|
7642
7642
|
const inlineRE$3 = /[?&]inline\b/;
|
7643
|
-
const svgExtRE = /\.svg(?:$|\?)/;
|
7644
7643
|
const assetCache = /* @__PURE__ */ new WeakMap();
|
7645
7644
|
/** a set of referenceId for entry CSS assets for each environment */
|
7646
7645
|
const cssEntriesMap = /* @__PURE__ */ new WeakMap();
|
@@ -7761,7 +7760,7 @@ async function fileToDevUrl(environment, id, skipBase = false) {
|
|
7761
7760
|
return assetToDataURL(environment, file, content);
|
7762
7761
|
}
|
7763
7762
|
const cleanedId = cleanUrl(id);
|
7764
|
-
if (
|
7763
|
+
if (cleanedId.endsWith(".svg")) {
|
7765
7764
|
const file = publicFile || cleanedId;
|
7766
7765
|
const content = await fsp.readFile(file);
|
7767
7766
|
if (shouldInline(environment, file, id, content, void 0, void 0)) return assetToDataURL(environment, file, content);
|
@@ -8366,8 +8365,9 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8366
8365
|
try {
|
8367
8366
|
const fileUrl = url$5.pathToFileURL(id).href;
|
8368
8367
|
const mod = await import(
|
8369
|
-
|
8370
|
-
|
8368
|
+
/* webpackIgnore: true */
|
8369
|
+
fileUrl
|
8370
|
+
);
|
8371
8371
|
return mod.default;
|
8372
8372
|
} catch (e$1) {
|
8373
8373
|
try {
|
@@ -12369,11 +12369,11 @@ function throwFileNotFoundInOptimizedDep(id) {
|
|
12369
12369
|
}
|
12370
12370
|
|
12371
12371
|
//#endregion
|
12372
|
-
//#region ../../node_modules/.pnpm/dotenv@17.0
|
12373
|
-
var require_package = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0
|
12372
|
+
//#region ../../node_modules/.pnpm/dotenv@17.2.0/node_modules/dotenv/package.json
|
12373
|
+
var require_package = __commonJS({ "../../node_modules/.pnpm/dotenv@17.2.0/node_modules/dotenv/package.json"(exports, module) {
|
12374
12374
|
module.exports = {
|
12375
12375
|
"name": "dotenv",
|
12376
|
-
"version": "17.0
|
12376
|
+
"version": "17.2.0",
|
12377
12377
|
"description": "Loads environment variables from .env file",
|
12378
12378
|
"main": "lib/main.js",
|
12379
12379
|
"types": "lib/main.d.ts",
|
@@ -12432,14 +12432,45 @@ var require_package = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_
|
|
12432
12432
|
} });
|
12433
12433
|
|
12434
12434
|
//#endregion
|
12435
|
-
//#region ../../node_modules/.pnpm/dotenv@17.0
|
12436
|
-
var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0
|
12435
|
+
//#region ../../node_modules/.pnpm/dotenv@17.2.0/node_modules/dotenv/lib/main.js
|
12436
|
+
var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.2.0/node_modules/dotenv/lib/main.js"(exports, module) {
|
12437
12437
|
const fs$11 = require("fs");
|
12438
12438
|
const path$10 = require("path");
|
12439
12439
|
const os$3 = require("os");
|
12440
12440
|
const crypto$2 = require("crypto");
|
12441
12441
|
const packageJson = require_package();
|
12442
12442
|
const version = packageJson.version;
|
12443
|
+
const TIPS = [
|
12444
|
+
"🔐 encrypt with dotenvx: https://dotenvx.com",
|
12445
|
+
"🔐 prevent committing .env to code: https://dotenvx.com/precommit",
|
12446
|
+
"🔐 prevent building .env in docker: https://dotenvx.com/prebuild",
|
12447
|
+
"🛠️ run anywhere with `dotenvx run -- yourcommand`",
|
12448
|
+
"⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
|
12449
|
+
"⚙️ enable debug logging with { debug: true }",
|
12450
|
+
"⚙️ override existing env vars with { override: true }",
|
12451
|
+
"⚙️ suppress all logs with { quiet: true }",
|
12452
|
+
"⚙️ write to custom object with { processEnv: myObject }",
|
12453
|
+
"⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
|
12454
|
+
];
|
12455
|
+
function _getRandomTip() {
|
12456
|
+
return TIPS[Math.floor(Math.random() * TIPS.length)];
|
12457
|
+
}
|
12458
|
+
function parseBoolean(value$1) {
|
12459
|
+
if (typeof value$1 === "string") return ![
|
12460
|
+
"false",
|
12461
|
+
"0",
|
12462
|
+
"no",
|
12463
|
+
"off",
|
12464
|
+
""
|
12465
|
+
].includes(value$1.toLowerCase());
|
12466
|
+
return Boolean(value$1);
|
12467
|
+
}
|
12468
|
+
function supportsAnsi() {
|
12469
|
+
return process.stdout.isTTY;
|
12470
|
+
}
|
12471
|
+
function dim(text) {
|
12472
|
+
return supportsAnsi() ? `\x1b[2m${text}\x1b[0m` : text;
|
12473
|
+
}
|
12443
12474
|
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
12444
12475
|
function parse$13(src) {
|
12445
12476
|
const obj = {};
|
@@ -12546,8 +12577,8 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_m
|
|
12546
12577
|
return envPath[0] === "~" ? path$10.join(os$3.homedir(), envPath.slice(1)) : envPath;
|
12547
12578
|
}
|
12548
12579
|
function _configVault(options$1) {
|
12549
|
-
const debug$19 =
|
12550
|
-
const quiet =
|
12580
|
+
const debug$19 = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options$1 && options$1.debug);
|
12581
|
+
const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options$1 && options$1.quiet);
|
12551
12582
|
if (debug$19 || !quiet) _log("Loading env from encrypted .env.vault");
|
12552
12583
|
const parsed = DotenvModule._parseVault(options$1);
|
12553
12584
|
let processEnv = process.env;
|
@@ -12558,8 +12589,10 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_m
|
|
12558
12589
|
function configDotenv(options$1) {
|
12559
12590
|
const dotenvPath = path$10.resolve(process.cwd(), ".env");
|
12560
12591
|
let encoding = "utf8";
|
12561
|
-
|
12562
|
-
|
12592
|
+
let processEnv = process.env;
|
12593
|
+
if (options$1 && options$1.processEnv != null) processEnv = options$1.processEnv;
|
12594
|
+
let debug$19 = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options$1 && options$1.debug);
|
12595
|
+
let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options$1 && options$1.quiet);
|
12563
12596
|
if (options$1 && options$1.encoding) encoding = options$1.encoding;
|
12564
12597
|
else if (debug$19) _debug("No encoding is specified. UTF-8 is used by default");
|
12565
12598
|
let optionPaths = [dotenvPath];
|
@@ -12577,9 +12610,9 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_m
|
|
12577
12610
|
if (debug$19) _debug(`Failed to load ${path$13} ${e$1.message}`);
|
12578
12611
|
lastError = e$1;
|
12579
12612
|
}
|
12580
|
-
let processEnv = process.env;
|
12581
|
-
if (options$1 && options$1.processEnv != null) processEnv = options$1.processEnv;
|
12582
12613
|
const populated = DotenvModule.populate(processEnv, parsedAll, options$1);
|
12614
|
+
debug$19 = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug$19);
|
12615
|
+
quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
|
12583
12616
|
if (debug$19 || !quiet) {
|
12584
12617
|
const keysCount = Object.keys(populated).length;
|
12585
12618
|
const shortPaths = [];
|
@@ -12590,7 +12623,7 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_m
|
|
12590
12623
|
if (debug$19) _debug(`Failed to load ${filePath} ${e$1.message}`);
|
12591
12624
|
lastError = e$1;
|
12592
12625
|
}
|
12593
|
-
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")}
|
12626
|
+
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`(tip: ${_getRandomTip()})`)}`);
|
12594
12627
|
}
|
12595
12628
|
if (lastError) return {
|
12596
12629
|
parsed: parsedAll,
|
@@ -13161,7 +13194,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13161
13194
|
* Module dependencies.
|
13162
13195
|
*/
|
13163
13196
|
var tty = require("tty");
|
13164
|
-
var util$
|
13197
|
+
var util$1 = require("util");
|
13165
13198
|
/**
|
13166
13199
|
* This is the Node.js implementation of `debug()`.
|
13167
13200
|
*
|
@@ -13211,7 +13244,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13211
13244
|
* $ DEBUG_FD=3 node script.js 3>debug.log
|
13212
13245
|
*/
|
13213
13246
|
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
13214
|
-
if (1 !== fd && 2 !== fd) util$
|
13247
|
+
if (1 !== fd && 2 !== fd) util$1.deprecate(function() {}, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
|
13215
13248
|
var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);
|
13216
13249
|
/**
|
13217
13250
|
* Is stdout a TTY? Colored output is enabled when `true`.
|
@@ -13224,7 +13257,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13224
13257
|
*/
|
13225
13258
|
exports.formatters.o = function(v) {
|
13226
13259
|
this.inspectOpts.colors = this.useColors;
|
13227
|
-
return util$
|
13260
|
+
return util$1.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
13228
13261
|
return str.trim();
|
13229
13262
|
}).join(" ");
|
13230
13263
|
};
|
@@ -13233,7 +13266,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13233
13266
|
*/
|
13234
13267
|
exports.formatters.O = function(v) {
|
13235
13268
|
this.inspectOpts.colors = this.useColors;
|
13236
|
-
return util$
|
13269
|
+
return util$1.inspect(v, this.inspectOpts);
|
13237
13270
|
};
|
13238
13271
|
/**
|
13239
13272
|
* Adds ANSI color escape codes if enabled.
|
@@ -13254,7 +13287,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13254
13287
|
* Invokes `util.format()` with the specified arguments and writes to `stream`.
|
13255
13288
|
*/
|
13256
13289
|
function log() {
|
13257
|
-
return stream.write(util$
|
13290
|
+
return stream.write(util$1.format.apply(util$1, arguments) + "\n");
|
13258
13291
|
}
|
13259
13292
|
/**
|
13260
13293
|
* Save `namespaces`.
|
@@ -15503,7 +15536,7 @@ var require_to_regex_range = __commonJS({ "../../node_modules/.pnpm/to-regex-ran
|
|
15503
15536
|
//#endregion
|
15504
15537
|
//#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
|
15505
15538
|
var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js"(exports, module) {
|
15506
|
-
const util
|
15539
|
+
const util = require("util");
|
15507
15540
|
const toRegexRange = require_to_regex_range();
|
15508
15541
|
const isObject$1 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
15509
15542
|
const transform$1 = (toNumber) => {
|
@@ -15576,7 +15609,7 @@ var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1
|
|
15576
15609
|
return toRegexRange(start, end, options$1);
|
15577
15610
|
};
|
15578
15611
|
const rangeError = (...args) => {
|
15579
|
-
return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util
|
15612
|
+
return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util.inspect(...args));
|
15580
15613
|
};
|
15581
15614
|
const invalidRange = (start, end, options$1) => {
|
15582
15615
|
if (options$1.strictRanges === true) throw rangeError([start, end]);
|
@@ -19454,6 +19487,37 @@ const isWsl = () => {
|
|
19454
19487
|
};
|
19455
19488
|
var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
19456
19489
|
|
19490
|
+
//#endregion
|
19491
|
+
//#region ../../node_modules/.pnpm/wsl-utils@0.1.0/node_modules/wsl-utils/index.js
|
19492
|
+
const wslDrivesMountPoint = (() => {
|
19493
|
+
const defaultMountPoint = "/mnt/";
|
19494
|
+
let mountPoint;
|
19495
|
+
return async function() {
|
19496
|
+
if (mountPoint) return mountPoint;
|
19497
|
+
const configFilePath = "/etc/wsl.conf";
|
19498
|
+
let isConfigFileExists = false;
|
19499
|
+
try {
|
19500
|
+
await fsp.access(configFilePath, constants.F_OK);
|
19501
|
+
isConfigFileExists = true;
|
19502
|
+
} catch {}
|
19503
|
+
if (!isConfigFileExists) return defaultMountPoint;
|
19504
|
+
const configContent = await fsp.readFile(configFilePath, { encoding: "utf8" });
|
19505
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
19506
|
+
if (!configMountPoint) return defaultMountPoint;
|
19507
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
19508
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
19509
|
+
return mountPoint;
|
19510
|
+
};
|
19511
|
+
})();
|
19512
|
+
const powerShellPathFromWsl = async () => {
|
19513
|
+
const mountPoint = await wslDrivesMountPoint();
|
19514
|
+
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
19515
|
+
};
|
19516
|
+
const powerShellPath = async () => {
|
19517
|
+
if (is_wsl_default) return powerShellPathFromWsl();
|
19518
|
+
return `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
19519
|
+
};
|
19520
|
+
|
19457
19521
|
//#endregion
|
19458
19522
|
//#region ../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
|
19459
19523
|
function defineLazyProperty(object, propertyName, valueGetter) {
|
@@ -19599,54 +19663,19 @@ async function defaultBrowser() {
|
|
19599
19663
|
}
|
19600
19664
|
|
19601
19665
|
//#endregion
|
19602
|
-
//#region ../../node_modules/.pnpm/open@10.
|
19603
|
-
const execFile$1 =
|
19666
|
+
//#region ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
|
19667
|
+
const execFile$1 = promisify(childProcess.execFile);
|
19604
19668
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
19605
19669
|
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
19606
19670
|
const { platform, arch } = process$1;
|
19607
19671
|
/**
|
19608
|
-
Get the mount point for fixed drives in WSL.
|
19609
|
-
|
19610
|
-
@inner
|
19611
|
-
@returns {string} The mount point.
|
19612
|
-
*/
|
19613
|
-
const getWslDrivesMountPoint = (() => {
|
19614
|
-
const defaultMountPoint = "/mnt/";
|
19615
|
-
let mountPoint;
|
19616
|
-
return async function() {
|
19617
|
-
if (mountPoint) return mountPoint;
|
19618
|
-
const configFilePath = "/etc/wsl.conf";
|
19619
|
-
let isConfigFileExists = false;
|
19620
|
-
try {
|
19621
|
-
await fsp.access(configFilePath, constants.F_OK);
|
19622
|
-
isConfigFileExists = true;
|
19623
|
-
} catch {}
|
19624
|
-
if (!isConfigFileExists) return defaultMountPoint;
|
19625
|
-
const configContent = await fsp.readFile(configFilePath, { encoding: "utf8" });
|
19626
|
-
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
19627
|
-
if (!configMountPoint) return defaultMountPoint;
|
19628
|
-
mountPoint = configMountPoint.groups.mountPoint.trim();
|
19629
|
-
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
19630
|
-
return mountPoint;
|
19631
|
-
};
|
19632
|
-
})();
|
19633
|
-
/**
|
19634
|
-
Get the PowerShell executable path in WSL environment.
|
19635
|
-
|
19636
|
-
@returns {Promise<string>} The absolute path to the PowerShell executable in WSL.
|
19637
|
-
*/
|
19638
|
-
const getPowershellPathFromWsl = async () => {
|
19639
|
-
const mountPoint = await getWslDrivesMountPoint();
|
19640
|
-
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
19641
|
-
};
|
19642
|
-
/**
|
19643
19672
|
Get the default browser name in Windows from WSL.
|
19644
19673
|
|
19645
19674
|
@returns {Promise<string>} Browser name.
|
19646
19675
|
*/
|
19647
19676
|
async function getWindowsDefaultBrowserFromWsl() {
|
19648
|
-
const powershellPath = await
|
19649
|
-
const rawCommand =
|
19677
|
+
const powershellPath = await powerShellPath();
|
19678
|
+
const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
19650
19679
|
const encodedCommand = Buffer$1.from(rawCommand, "utf16le").toString("base64");
|
19651
19680
|
const { stdout } = await execFile$1(powershellPath, [
|
19652
19681
|
"-NoProfile",
|
@@ -19659,6 +19688,7 @@ async function getWindowsDefaultBrowserFromWsl() {
|
|
19659
19688
|
const progId = stdout.trim();
|
19660
19689
|
const browserMap = {
|
19661
19690
|
ChromeHTML: "com.google.chrome",
|
19691
|
+
BraveHTML: "com.brave.Browser",
|
19662
19692
|
MSEdgeHTM: "com.microsoft.edge",
|
19663
19693
|
FirefoxURL: "org.mozilla.firefox"
|
19664
19694
|
};
|
@@ -19698,6 +19728,7 @@ const baseOpen = async (options$1) => {
|
|
19698
19728
|
const ids = {
|
19699
19729
|
"com.google.chrome": "chrome",
|
19700
19730
|
"google-chrome.desktop": "chrome",
|
19731
|
+
"com.brave.Browser": "brave",
|
19701
19732
|
"org.mozilla.firefox": "firefox",
|
19702
19733
|
"firefox.desktop": "firefox",
|
19703
19734
|
"com.microsoft.msedge": "edge",
|
@@ -19707,6 +19738,7 @@ const baseOpen = async (options$1) => {
|
|
19707
19738
|
};
|
19708
19739
|
const flags = {
|
19709
19740
|
chrome: "--incognito",
|
19741
|
+
brave: "--incognito",
|
19710
19742
|
firefox: "--private-window",
|
19711
19743
|
edge: "--inPrivate"
|
19712
19744
|
};
|
@@ -19734,7 +19766,7 @@ const baseOpen = async (options$1) => {
|
|
19734
19766
|
if (options$1.newInstance) cliArguments.push("--new");
|
19735
19767
|
if (app) cliArguments.push("-a", app);
|
19736
19768
|
} else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
|
19737
|
-
command =
|
19769
|
+
command = await powerShellPath();
|
19738
19770
|
cliArguments.push("-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand");
|
19739
19771
|
if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
|
19740
19772
|
const encodedArguments = ["Start"];
|
@@ -19813,9 +19845,17 @@ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
19813
19845
|
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
19814
19846
|
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
19815
19847
|
} }));
|
19848
|
+
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
19849
|
+
darwin: "brave browser",
|
19850
|
+
win32: "brave",
|
19851
|
+
linux: ["brave-browser", "brave"]
|
19852
|
+
}, { wsl: {
|
19853
|
+
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
19854
|
+
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
19855
|
+
} }));
|
19816
19856
|
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
19817
19857
|
darwin: "firefox",
|
19818
|
-
win32:
|
19858
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
19819
19859
|
linux: "firefox"
|
19820
19860
|
}, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
|
19821
19861
|
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
@@ -26299,9 +26339,8 @@ function transformRequest(environment, url$6, options$1 = {}) {
|
|
26299
26339
|
ssr: environment.config.consumer === "server"
|
26300
26340
|
};
|
26301
26341
|
if (environment._closing && environment.config.dev.recoverable) throwClosedServerError();
|
26302
|
-
const cacheKey = `${options$1.html ? "html:" : ""}${url$6}`;
|
26303
26342
|
const timestamp = monotonicDateNow();
|
26304
|
-
const pending = environment._pendingRequests.get(
|
26343
|
+
const pending = environment._pendingRequests.get(url$6);
|
26305
26344
|
if (pending) return environment.moduleGraph.getModuleByUrl(removeTimestampQuery(url$6)).then((module$1) => {
|
26306
26345
|
if (!module$1 || pending.timestamp > module$1.lastInvalidationTimestamp) return pending.request;
|
26307
26346
|
else {
|
@@ -26313,11 +26352,11 @@ function transformRequest(environment, url$6, options$1 = {}) {
|
|
26313
26352
|
let cleared = false;
|
26314
26353
|
const clearCache = () => {
|
26315
26354
|
if (!cleared) {
|
26316
|
-
environment._pendingRequests.delete(
|
26355
|
+
environment._pendingRequests.delete(url$6);
|
26317
26356
|
cleared = true;
|
26318
26357
|
}
|
26319
26358
|
};
|
26320
|
-
environment._pendingRequests.set(
|
26359
|
+
environment._pendingRequests.set(url$6, {
|
26321
26360
|
request,
|
26322
26361
|
timestamp,
|
26323
26362
|
abort: clearCache
|
@@ -26373,16 +26412,12 @@ async function loadAndTransform(environment, id, url$6, options$1, timestamp, mo
|
|
26373
26412
|
const loadResult = await pluginContainer.load(id);
|
26374
26413
|
if (loadResult == null) {
|
26375
26414
|
const file = cleanUrl(id);
|
26376
|
-
if (options$1.html && !id.endsWith(".html")) return null;
|
26377
26415
|
if (environment.config.consumer === "server" || isFileLoadingAllowed(environment.getTopLevelConfig(), file)) {
|
26378
26416
|
try {
|
26379
26417
|
code = await fsp.readFile(file, "utf-8");
|
26380
26418
|
debugLoad?.(`${timeFrom(loadStart)} [fs] ${prettyUrl}`);
|
26381
26419
|
} catch (e$1) {
|
26382
|
-
if (e$1.code !== "ENOENT")
|
26383
|
-
if (e$1.code === "EISDIR") e$1.message = `${e$1.message} ${file}`;
|
26384
|
-
throw e$1;
|
26385
|
-
}
|
26420
|
+
if (e$1.code !== "ENOENT" && e$1.code !== "EISDIR") throw e$1;
|
26386
26421
|
}
|
26387
26422
|
if (code != null && environment.pluginContainer.watcher) ensureWatchedFile(environment.pluginContainer.watcher, file, config$2.root);
|
26388
26423
|
}
|
@@ -27501,12 +27536,9 @@ function transformMiddleware(server) {
|
|
27501
27536
|
return res.end();
|
27502
27537
|
}
|
27503
27538
|
}
|
27504
|
-
const result = await transformRequest(environment, url$6, {
|
27505
|
-
|
27506
|
-
|
27507
|
-
return id.startsWith("\0") || !deniedServingAccessForTransform(id, server, res, next);
|
27508
|
-
}
|
27509
|
-
});
|
27539
|
+
const result = await transformRequest(environment, url$6, { allowId(id) {
|
27540
|
+
return id.startsWith("\0") || !deniedServingAccessForTransform(id, server, res, next);
|
27541
|
+
} });
|
27510
27542
|
if (result) {
|
27511
27543
|
const depsOptimizer = environment.depsOptimizer;
|
27512
27544
|
const type = isDirectCSSRequest(url$6) ? "css" : "js";
|
@@ -30590,7 +30622,10 @@ function assetImportMetaUrlPlugin(config$2) {
|
|
30590
30622
|
if (publicDir && isParentDirectory(publicDir, file)) {
|
30591
30623
|
const publicPath = "/" + path.posix.relative(publicDir, file);
|
30592
30624
|
builtUrl = await fileToUrl$1(this, publicPath);
|
30593
|
-
} else
|
30625
|
+
} else {
|
30626
|
+
this.addWatchFile(file);
|
30627
|
+
builtUrl = await fileToUrl$1(this, file);
|
30628
|
+
}
|
30594
30629
|
} catch {}
|
30595
30630
|
if (!builtUrl) {
|
30596
30631
|
const rawExp = code.slice(startIndex, endIndex);
|
@@ -30896,7 +30931,7 @@ function createFilterForTransform(idFilter, codeFilter, cwd) {
|
|
30896
30931
|
async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins) {
|
30897
30932
|
const isBuild = config$2.command === "build";
|
30898
30933
|
const isWorker = config$2.isWorker;
|
30899
|
-
const buildPlugins = isBuild ? await (await import("./dep-
|
30934
|
+
const buildPlugins = isBuild ? await (await import("./dep-EUZWNfwr.js")).resolveBuildPlugins(config$2) : {
|
30900
30935
|
pre: [],
|
30901
30936
|
post: []
|
30902
30937
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
-
import { preview, resolvePreviewOptions } from "./dep-
|
2
|
+
import { preview, resolvePreviewOptions } from "./dep-Bg4HVnP5.js";
|
3
3
|
import "./dep-Ctugieod.js";
|
4
4
|
|
5
5
|
export { preview };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
-
import { _createServer, createServer, createServerCloseFn, resolveServerOptions, restartServerWithUrls, serverConfigDefaults } from "./dep-
|
2
|
+
import { _createServer, createServer, createServerCloseFn, resolveServerOptions, restartServerWithUrls, serverConfigDefaults } from "./dep-Bg4HVnP5.js";
|
3
3
|
import "./dep-Ctugieod.js";
|
4
4
|
|
5
5
|
export { createServer };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
-
import { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies } from "./dep-
|
2
|
+
import { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies } from "./dep-Bg4HVnP5.js";
|
3
3
|
import "./dep-Ctugieod.js";
|
4
4
|
|
5
5
|
export { optimizeDeps };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
-
import { BuildEnvironment, build, buildEnvironmentOptionsDefaults, builderOptionsDefaults, createBuilder, createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, onRollupLog, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveLibFilename, resolveUserExternal, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime } from "./dep-
|
2
|
+
import { BuildEnvironment, build, buildEnvironmentOptionsDefaults, builderOptionsDefaults, createBuilder, createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, onRollupLog, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveLibFilename, resolveUserExternal, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime } from "./dep-Bg4HVnP5.js";
|
3
3
|
import "./dep-Ctugieod.js";
|
4
4
|
|
5
5
|
export { createBuilder, resolveBuildPlugins };
|
package/dist/node/cli.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
2
|
import { __toESM } from "./chunks/dep-Drtntmtt.js";
|
3
|
-
import { createLogger, require_picocolors, resolveConfig } from "./chunks/dep-
|
3
|
+
import { createLogger, require_picocolors, resolveConfig } from "./chunks/dep-Bg4HVnP5.js";
|
4
4
|
import { VERSION } from "./chunks/dep-Ctugieod.js";
|
5
5
|
import fs from "node:fs";
|
6
6
|
import path from "node:path";
|
@@ -568,7 +568,7 @@ const convertBase = (v) => {
|
|
568
568
|
cli.option("-c, --config <file>", `[string] use specified config file`).option("--base <path>", `[string] public base path (default: /)`, { type: [convertBase] }).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).option("--configLoader <loader>", `[string] use 'bundle' to bundle the config with esbuild, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)`).option("-d, --debug [feat]", `[string | boolean] show debug logs`).option("-f, --filter <filter>", `[string] filter debug logs`).option("-m, --mode <mode>", `[string] set env mode`);
|
569
569
|
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--open [path]", `[boolean | string] open browser on startup`).option("--cors", `[boolean] enable CORS`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--force", `[boolean] force the optimizer to ignore the cache and re-bundle`).action(async (root, options) => {
|
570
570
|
filterDuplicateOptions(options);
|
571
|
-
const { createServer } = await import("./chunks/dep-
|
571
|
+
const { createServer } = await import("./chunks/dep-DPmIzJpk.js");
|
572
572
|
try {
|
573
573
|
const server = await createServer({
|
574
574
|
root,
|
@@ -624,7 +624,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
624
624
|
});
|
625
625
|
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'baseline-widely-available')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option("--assetsDir <dir>", `[string] directory under outDir to place assets in (default: assets)`).option("--assetsInlineLimit <number>", `[number] static asset base64 inline threshold in bytes (default: 4096)`).option("--ssr [entry]", `[string] build specified entry for server-side rendering`).option("--sourcemap [output]", `[boolean | "inline" | "hidden"] output source maps for build (default: false)`).option("--minify [minifier]", "[boolean | \"terser\" | \"esbuild\"] enable/disable minification, or specify minifier to use (default: esbuild)").option("--manifest [name]", `[boolean | string] emit build manifest json`).option("--ssrManifest [name]", `[boolean | string] emit ssr manifest json`).option("--emptyOutDir", `[boolean] force empty outDir when it's outside of root`).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(async (root, options) => {
|
626
626
|
filterDuplicateOptions(options);
|
627
|
-
const { createBuilder } = await import("./chunks/dep-
|
627
|
+
const { createBuilder } = await import("./chunks/dep-EUZWNfwr.js");
|
628
628
|
const buildOptions = cleanGlobalCLIOptions(cleanBuilderCLIOptions(options));
|
629
629
|
try {
|
630
630
|
const inlineConfig = {
|
@@ -649,7 +649,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
649
649
|
});
|
650
650
|
cli.command("optimize [root]", "pre-bundle dependencies (deprecated, the pre-bundle process runs automatically and does not need to be called)").option("--force", `[boolean] force the optimizer to ignore the cache and re-bundle`).action(async (root, options) => {
|
651
651
|
filterDuplicateOptions(options);
|
652
|
-
const { optimizeDeps } = await import("./chunks/dep-
|
652
|
+
const { optimizeDeps } = await import("./chunks/dep-Dunozww-.js");
|
653
653
|
try {
|
654
654
|
const config = await resolveConfig({
|
655
655
|
root,
|
@@ -667,7 +667,7 @@ cli.command("optimize [root]", "pre-bundle dependencies (deprecated, the pre-bun
|
|
667
667
|
});
|
668
668
|
cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(async (root, options) => {
|
669
669
|
filterDuplicateOptions(options);
|
670
|
-
const { preview } = await import("./chunks/dep-
|
670
|
+
const { preview } = await import("./chunks/dep-Bkky1B58.js");
|
671
671
|
try {
|
672
672
|
const server = await preview({
|
673
673
|
root,
|
package/dist/node/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
-
import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/dep-
|
2
|
+
import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/dep-Bg4HVnP5.js";
|
3
3
|
import { DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, VERSION, defaultAllowedOrigins } from "./chunks/dep-Ctugieod.js";
|
4
4
|
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
5
5
|
import { version as esbuildVersion } from "esbuild";
|
@@ -1,13 +1,7 @@
|
|
1
|
-
/**
|
2
|
-
* Prefix for resolved Ids that are not valid browser import specifiers
|
3
|
-
*/
|
4
1
|
const VALID_ID_PREFIX = "/@id/", NULL_BYTE_PLACEHOLDER = "__x00__";
|
5
2
|
let SOURCEMAPPING_URL = "sourceMa";
|
6
3
|
SOURCEMAPPING_URL += "ppingURL";
|
7
4
|
const ERR_OUTDATED_OPTIMIZED_DEP = "ERR_OUTDATED_OPTIMIZED_DEP", isWindows = typeof process < "u" && process.platform === "win32";
|
8
|
-
/**
|
9
|
-
* Undo {@link wrapId}'s `/@id/` and null byte replacements.
|
10
|
-
*/
|
11
5
|
function unwrapId(id) {
|
12
6
|
return id.startsWith(VALID_ID_PREFIX) ? id.slice(VALID_ID_PREFIX.length).replace(NULL_BYTE_PLACEHOLDER, "\0") : id;
|
13
7
|
}
|
@@ -245,10 +239,10 @@ function getOriginalPosition(map, needle) {
|
|
245
239
|
let result = originalPositionFor(map, needle);
|
246
240
|
return result.column == null ? null : result;
|
247
241
|
}
|
248
|
-
const MODULE_RUNNER_SOURCEMAPPING_REGEXP =
|
242
|
+
const MODULE_RUNNER_SOURCEMAPPING_REGEXP = RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
|
249
243
|
var EvaluatedModuleNode = class {
|
250
|
-
importers =
|
251
|
-
imports =
|
244
|
+
importers = new Set();
|
245
|
+
imports = new Set();
|
252
246
|
evaluated = !1;
|
253
247
|
meta;
|
254
248
|
promise;
|
@@ -259,43 +253,18 @@ var EvaluatedModuleNode = class {
|
|
259
253
|
this.id = id, this.url = url, this.file = cleanUrl(id);
|
260
254
|
}
|
261
255
|
}, EvaluatedModules = class {
|
262
|
-
idToModuleMap =
|
263
|
-
fileToModulesMap =
|
264
|
-
urlToIdModuleMap =
|
265
|
-
/**
|
266
|
-
* Returns the module node by the resolved module ID. Usually, module ID is
|
267
|
-
* the file system path with query and/or hash. It can also be a virtual module.
|
268
|
-
*
|
269
|
-
* Module runner graph will have 1 to 1 mapping with the server module graph.
|
270
|
-
* @param id Resolved module ID
|
271
|
-
*/
|
256
|
+
idToModuleMap = new Map();
|
257
|
+
fileToModulesMap = new Map();
|
258
|
+
urlToIdModuleMap = new Map();
|
272
259
|
getModuleById(id) {
|
273
260
|
return this.idToModuleMap.get(id);
|
274
261
|
}
|
275
|
-
/**
|
276
|
-
* Returns all modules related to the file system path. Different modules
|
277
|
-
* might have different query parameters or hash, so it's possible to have
|
278
|
-
* multiple modules for the same file.
|
279
|
-
* @param file The file system path of the module
|
280
|
-
*/
|
281
262
|
getModulesByFile(file) {
|
282
263
|
return this.fileToModulesMap.get(file);
|
283
264
|
}
|
284
|
-
/**
|
285
|
-
* Returns the module node by the URL that was used in the import statement.
|
286
|
-
* Unlike module graph on the server, the URL is not resolved and is used as is.
|
287
|
-
* @param url Server URL that was used in the import statement
|
288
|
-
*/
|
289
265
|
getModuleByUrl(url) {
|
290
266
|
return this.urlToIdModuleMap.get(unwrapId(url));
|
291
267
|
}
|
292
|
-
/**
|
293
|
-
* Ensure that module is in the graph. If the module is already in the graph,
|
294
|
-
* it will return the existing module node. Otherwise, it will create a new
|
295
|
-
* module node and add it to the graph.
|
296
|
-
* @param id Resolved module ID
|
297
|
-
* @param url URL that was used in the import statement
|
298
|
-
*/
|
299
268
|
ensureModule(id, url) {
|
300
269
|
if (id = normalizeModuleId(id), this.idToModuleMap.has(id)) {
|
301
270
|
let moduleNode$1 = this.idToModuleMap.get(id);
|
@@ -303,17 +272,12 @@ var EvaluatedModuleNode = class {
|
|
303
272
|
}
|
304
273
|
let moduleNode = new EvaluatedModuleNode(id, url);
|
305
274
|
this.idToModuleMap.set(id, moduleNode), this.urlToIdModuleMap.set(url, moduleNode);
|
306
|
-
let fileModules = this.fileToModulesMap.get(moduleNode.file) ||
|
275
|
+
let fileModules = this.fileToModulesMap.get(moduleNode.file) || new Set();
|
307
276
|
return fileModules.add(moduleNode), this.fileToModulesMap.set(moduleNode.file, fileModules), moduleNode;
|
308
277
|
}
|
309
278
|
invalidateModule(node) {
|
310
279
|
node.evaluated = !1, node.meta = void 0, node.map = void 0, node.promise = void 0, node.exports = void 0, node.imports.clear();
|
311
280
|
}
|
312
|
-
/**
|
313
|
-
* Extracts the inlined source map from the module code and returns the decoded
|
314
|
-
* source map. If the source map is not inlined, it will return null.
|
315
|
-
* @param id Resolved module ID
|
316
|
-
*/
|
317
281
|
getModuleSourceMapById(id) {
|
318
282
|
let mod = this.getModuleById(id);
|
319
283
|
if (!mod) return null;
|
@@ -348,7 +312,7 @@ var HMRContext = class {
|
|
348
312
|
let listeners = hmrClient.customListenersMap.get(event);
|
349
313
|
listeners && hmrClient.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
|
350
314
|
}
|
351
|
-
this.newListeners =
|
315
|
+
this.newListeners = new Map(), hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);
|
352
316
|
}
|
353
317
|
get data() {
|
354
318
|
return this.hmrClient.dataMap.get(this.ownerPath);
|
@@ -419,12 +383,12 @@ var HMRContext = class {
|
|
419
383
|
}), this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
|
420
384
|
}
|
421
385
|
}, HMRClient = class {
|
422
|
-
hotModulesMap =
|
423
|
-
disposeMap =
|
424
|
-
pruneMap =
|
425
|
-
dataMap =
|
426
|
-
customListenersMap =
|
427
|
-
ctxToListenersMap =
|
386
|
+
hotModulesMap = new Map();
|
387
|
+
disposeMap = new Map();
|
388
|
+
pruneMap = new Map();
|
389
|
+
dataMap = new Map();
|
390
|
+
customListenersMap = new Map();
|
391
|
+
ctxToListenersMap = new Map();
|
428
392
|
currentFirstInvalidatedBy;
|
429
393
|
constructor(logger, transport, importUpdatedModule) {
|
430
394
|
this.logger = logger, this.transport = transport, this.importUpdatedModule = importUpdatedModule;
|
@@ -455,11 +419,6 @@ var HMRContext = class {
|
|
455
419
|
}
|
456
420
|
updateQueue = [];
|
457
421
|
pendingUpdateQueue = !1;
|
458
|
-
/**
|
459
|
-
* buffer multiple hot updates triggered by the same src change
|
460
|
-
* so that they are invoked in the same order they were sent.
|
461
|
-
* (otherwise the order may be inconsistent because of the http request round trip)
|
462
|
-
*/
|
463
422
|
async queueUpdate(payload) {
|
464
423
|
if (this.updateQueue.push(this.fetchUpdate(payload)), !this.pendingUpdateQueue) {
|
465
424
|
this.pendingUpdateQueue = !0, await Promise.resolve(), this.pendingUpdateQueue = !1;
|
@@ -492,11 +451,6 @@ var HMRContext = class {
|
|
492
451
|
};
|
493
452
|
}
|
494
453
|
};
|
495
|
-
/**
|
496
|
-
* Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.
|
497
|
-
* Top-level imports and dynamic imports work slightly differently in Node.js.
|
498
|
-
* This function normalizes the differences so it matches prod behaviour.
|
499
|
-
*/
|
500
454
|
function analyzeImportedModDifference(mod, rawId, moduleType, metadata) {
|
501
455
|
if (!metadata?.isDynamicImport && metadata?.importedNames?.length) {
|
502
456
|
let missingBindings = metadata.importedNames.filter((s) => !(s in mod));
|
@@ -519,7 +473,7 @@ let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzr
|
|
519
473
|
};
|
520
474
|
function reviveInvokeError(e) {
|
521
475
|
let error = Error(e.message || "Unknown invoke error");
|
522
|
-
return Object.assign(error, e, { runnerError:
|
476
|
+
return Object.assign(error, e, { runnerError: Error("RunnerError") }), error;
|
523
477
|
}
|
524
478
|
const createInvokeableTransport = (transport) => {
|
525
479
|
if (transport.invoke) return {
|
@@ -539,7 +493,7 @@ const createInvokeableTransport = (transport) => {
|
|
539
493
|
}
|
540
494
|
};
|
541
495
|
if (!transport.send || !transport.connect) throw Error("transport must implement send and connect when invoke is not implemented");
|
542
|
-
let rpcPromises =
|
496
|
+
let rpcPromises = new Map();
|
543
497
|
return {
|
544
498
|
...transport,
|
545
499
|
connect({ onMessage, onDisconnection }) {
|
@@ -563,7 +517,7 @@ const createInvokeableTransport = (transport) => {
|
|
563
517
|
},
|
564
518
|
disconnect() {
|
565
519
|
return rpcPromises.forEach((promise) => {
|
566
|
-
promise.reject(
|
520
|
+
promise.reject(Error(`transport was disconnected, cannot call ${JSON.stringify(promise.name)}`));
|
567
521
|
}), rpcPromises.clear(), transport.disconnect?.();
|
568
522
|
},
|
569
523
|
send(data) {
|
@@ -580,7 +534,7 @@ const createInvokeableTransport = (transport) => {
|
|
580
534
|
}
|
581
535
|
}, sendPromise = transport.send(wrappedData), { promise, resolve: resolve$1, reject } = promiseWithResolvers(), timeout = transport.timeout ?? 6e4, timeoutId;
|
582
536
|
timeout > 0 && (timeoutId = setTimeout(() => {
|
583
|
-
rpcPromises.delete(promiseId), reject(
|
537
|
+
rpcPromises.delete(promiseId), reject(Error(`transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})`));
|
584
538
|
}, timeout), timeoutId?.unref?.()), rpcPromises.set(promiseId, {
|
585
539
|
resolve: resolve$1,
|
586
540
|
reject,
|
@@ -644,7 +598,7 @@ const createInvokeableTransport = (transport) => {
|
|
644
598
|
isOpened = !0, resolve$1();
|
645
599
|
}, { once: !0 }), socket.addEventListener("close", async () => {
|
646
600
|
if (!isOpened) {
|
647
|
-
reject(
|
601
|
+
reject(Error("WebSocket closed without opened."));
|
648
602
|
return;
|
649
603
|
}
|
650
604
|
onMessage({
|
@@ -747,7 +701,7 @@ function getModulesByFile(runner, file) {
|
|
747
701
|
let nodes = runner.evaluatedModules.getModulesByFile(file);
|
748
702
|
return nodes ? [...nodes].map((node) => node.id) : [];
|
749
703
|
}
|
750
|
-
function getModulesEntrypoints(runner, modules, visited =
|
704
|
+
function getModulesEntrypoints(runner, modules, visited = new Set(), entrypoints = new Set()) {
|
751
705
|
for (let moduleId of modules) {
|
752
706
|
if (visited.has(moduleId)) continue;
|
753
707
|
visited.add(moduleId);
|
@@ -761,11 +715,11 @@ function getModulesEntrypoints(runner, modules, visited = /* @__PURE__ */ new Se
|
|
761
715
|
}
|
762
716
|
return entrypoints;
|
763
717
|
}
|
764
|
-
function findAllEntrypoints(runner, entrypoints =
|
718
|
+
function findAllEntrypoints(runner, entrypoints = new Set()) {
|
765
719
|
for (let mod of runner.evaluatedModules.idToModuleMap.values()) mod.importers.size || entrypoints.add(mod.url);
|
766
720
|
return entrypoints;
|
767
721
|
}
|
768
|
-
const sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache =
|
722
|
+
const sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = new Set(), retrieveFileHandlers = new Set(), retrieveSourceMapHandlers = new Set(), createExecHandlers = (handlers) => (...args) => {
|
769
723
|
for (let handler of handlers) {
|
770
724
|
let result = handler(...args);
|
771
725
|
if (result) return result;
|
@@ -966,7 +920,7 @@ var ESModulesEvaluator = class {
|
|
966
920
|
} });
|
967
921
|
transport;
|
968
922
|
resetSourceMapSupport;
|
969
|
-
concurrentModuleNodePromises =
|
923
|
+
concurrentModuleNodePromises = new Map();
|
970
924
|
closed = !1;
|
971
925
|
constructor(options, evaluator = new ESModulesEvaluator(), debug) {
|
972
926
|
if (this.options = options, this.evaluator = evaluator, this.debug = debug, this.evaluatedModules = options.evaluatedModules ?? new EvaluatedModules(), this.transport = normalizeModuleRunnerTransport(options.transport), options.hmr !== !1) {
|
@@ -976,29 +930,16 @@ var ESModulesEvaluator = class {
|
|
976
930
|
} else this.transport.connect?.();
|
977
931
|
options.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = enableSourceMapSupport(this));
|
978
932
|
}
|
979
|
-
/**
|
980
|
-
* URL to execute. Accepts file path, server path or id relative to the root.
|
981
|
-
*/
|
982
933
|
async import(url) {
|
983
934
|
let fetchedModule = await this.cachedModule(url);
|
984
935
|
return await this.cachedRequest(url, fetchedModule);
|
985
936
|
}
|
986
|
-
/**
|
987
|
-
* Clear all caches including HMR listeners.
|
988
|
-
*/
|
989
937
|
clearCache() {
|
990
938
|
this.evaluatedModules.clear(), this.hmrClient?.clear();
|
991
939
|
}
|
992
|
-
/**
|
993
|
-
* Clears all caches, removes all HMR listeners, and resets source map support.
|
994
|
-
* This method doesn't stop the HMR connection.
|
995
|
-
*/
|
996
940
|
async close() {
|
997
941
|
this.resetSourceMapSupport?.(), this.clearCache(), this.hmrClient = void 0, this.closed = !0, await this.transport.disconnect?.();
|
998
942
|
}
|
999
|
-
/**
|
1000
|
-
* Returns `true` if the runtime has been closed by calling `close()` method.
|
1001
|
-
*/
|
1002
943
|
isClosed() {
|
1003
944
|
return this.closed;
|
1004
945
|
}
|
@@ -1011,7 +952,7 @@ var ESModulesEvaluator = class {
|
|
1011
952
|
for (let importedFile of mod.imports) if (mod.importers.has(importedFile)) return !0;
|
1012
953
|
return !1;
|
1013
954
|
}
|
1014
|
-
isCircularImport(importers, moduleUrl, visited =
|
955
|
+
isCircularImport(importers, moduleUrl, visited = new Set()) {
|
1015
956
|
for (let importer of importers) {
|
1016
957
|
if (visited.has(importer)) continue;
|
1017
958
|
if (visited.add(importer), importer === moduleUrl) return !0;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "7.0.
|
3
|
+
"version": "7.0.5",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -82,7 +82,7 @@
|
|
82
82
|
"@ampproject/remapping": "^2.3.0",
|
83
83
|
"@babel/parser": "^7.28.0",
|
84
84
|
"@jridgewell/trace-mapping": "^0.3.29",
|
85
|
-
"@oxc-project/types": "0.
|
85
|
+
"@oxc-project/types": "0.77.0",
|
86
86
|
"@polka/compression": "^1.0.0-next.25",
|
87
87
|
"@rollup/plugin-alias": "^5.1.1",
|
88
88
|
"@rollup/plugin-commonjs": "^28.0.6",
|
@@ -91,7 +91,7 @@
|
|
91
91
|
"@types/escape-html": "^1.0.4",
|
92
92
|
"@types/pnpapi": "^0.0.5",
|
93
93
|
"artichokie": "^0.3.2",
|
94
|
-
"baseline-browser-mapping": "^2.
|
94
|
+
"baseline-browser-mapping": "^2.5.3",
|
95
95
|
"cac": "^6.7.14",
|
96
96
|
"chokidar": "^3.6.0",
|
97
97
|
"connect": "^3.7.0",
|
@@ -100,7 +100,7 @@
|
|
100
100
|
"cross-spawn": "^7.0.6",
|
101
101
|
"debug": "^4.4.1",
|
102
102
|
"dep-types": "link:./src/types",
|
103
|
-
"dotenv": "^17.0
|
103
|
+
"dotenv": "^17.2.0",
|
104
104
|
"dotenv-expand": "^12.0.2",
|
105
105
|
"es-module-lexer": "^1.7.0",
|
106
106
|
"escape-html": "^1.0.3",
|
@@ -114,7 +114,7 @@
|
|
114
114
|
"mlly": "^1.7.4",
|
115
115
|
"mrmime": "^2.0.1",
|
116
116
|
"nanoid": "^5.1.5",
|
117
|
-
"open": "^10.
|
117
|
+
"open": "^10.2.0",
|
118
118
|
"parse5": "^7.3.0",
|
119
119
|
"pathe": "^2.0.3",
|
120
120
|
"periscopic": "^4.0.2",
|
@@ -124,7 +124,7 @@
|
|
124
124
|
"postcss-modules": "^6.0.1",
|
125
125
|
"premove": "^4.0.0",
|
126
126
|
"resolve.exports": "^2.0.3",
|
127
|
-
"rolldown": "^1.0.0-beta.
|
127
|
+
"rolldown": "^1.0.0-beta.27",
|
128
128
|
"rolldown-plugin-dts": "^0.13.13",
|
129
129
|
"rollup-plugin-license": "^3.6.0",
|
130
130
|
"sass": "^1.89.2",
|