vite 7.0.3 → 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-DPTTEEJb.js → dep-Bg4HVnP5.js} +129 -91
- package/dist/node/chunks/{dep-jWBpl9SM.js → dep-Bkky1B58.js} +1 -1
- package/dist/node/chunks/{dep-B-ryHkZW.js → dep-DPmIzJpk.js} +1 -1
- package/dist/node/chunks/{dep-KrYKmVjB.js → dep-Dunozww-.js} +1 -1
- package/dist/node/chunks/{dep-BT17fY0B.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 -7
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 {
|
@@ -10716,7 +10716,10 @@ async function computeEntries(environment) {
|
|
10716
10716
|
if (explicitEntryPatterns) entries = await globEntries(explicitEntryPatterns, environment);
|
10717
10717
|
else if (buildInput) {
|
10718
10718
|
const resolvePath = async (p$1) => {
|
10719
|
-
const id = (await environment.pluginContainer.resolveId(p$1, path.join(process.cwd(), "*"), {
|
10719
|
+
const id = (await environment.pluginContainer.resolveId(p$1, path.join(process.cwd(), "*"), {
|
10720
|
+
isEntry: true,
|
10721
|
+
scan: true
|
10722
|
+
}))?.id;
|
10720
10723
|
if (id === void 0) throw new Error(`failed to resolve rollupOptions.input value: ${JSON.stringify(p$1)}.`);
|
10721
10724
|
return id;
|
10722
10725
|
};
|
@@ -11856,7 +11859,7 @@ function resolvePlugin(resolveOptions) {
|
|
11856
11859
|
return ensureVersionQuery(res, id, options$1, depsOptimizer);
|
11857
11860
|
}
|
11858
11861
|
}
|
11859
|
-
if (id[0] === "." || (preferRelative || importer?.endsWith(".html")) && startsWithWordCharRE.test(id)) {
|
11862
|
+
if (id[0] === "." || (preferRelative || resolveOpts.isEntry || importer?.endsWith(".html")) && startsWithWordCharRE.test(id)) {
|
11860
11863
|
const basedir = importer ? path.dirname(importer) : process.cwd();
|
11861
11864
|
const fsPath = path.resolve(basedir, id);
|
11862
11865
|
const normalizedFsPath = normalizePath(fsPath);
|
@@ -12366,11 +12369,11 @@ function throwFileNotFoundInOptimizedDep(id) {
|
|
12366
12369
|
}
|
12367
12370
|
|
12368
12371
|
//#endregion
|
12369
|
-
//#region ../../node_modules/.pnpm/dotenv@17.0
|
12370
|
-
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) {
|
12371
12374
|
module.exports = {
|
12372
12375
|
"name": "dotenv",
|
12373
|
-
"version": "17.0
|
12376
|
+
"version": "17.2.0",
|
12374
12377
|
"description": "Loads environment variables from .env file",
|
12375
12378
|
"main": "lib/main.js",
|
12376
12379
|
"types": "lib/main.d.ts",
|
@@ -12429,14 +12432,45 @@ var require_package = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_
|
|
12429
12432
|
} });
|
12430
12433
|
|
12431
12434
|
//#endregion
|
12432
|
-
//#region ../../node_modules/.pnpm/dotenv@17.0
|
12433
|
-
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) {
|
12434
12437
|
const fs$11 = require("fs");
|
12435
12438
|
const path$10 = require("path");
|
12436
12439
|
const os$3 = require("os");
|
12437
12440
|
const crypto$2 = require("crypto");
|
12438
12441
|
const packageJson = require_package();
|
12439
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
|
+
}
|
12440
12474
|
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
12441
12475
|
function parse$13(src) {
|
12442
12476
|
const obj = {};
|
@@ -12543,8 +12577,8 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_m
|
|
12543
12577
|
return envPath[0] === "~" ? path$10.join(os$3.homedir(), envPath.slice(1)) : envPath;
|
12544
12578
|
}
|
12545
12579
|
function _configVault(options$1) {
|
12546
|
-
const debug$19 =
|
12547
|
-
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);
|
12548
12582
|
if (debug$19 || !quiet) _log("Loading env from encrypted .env.vault");
|
12549
12583
|
const parsed = DotenvModule._parseVault(options$1);
|
12550
12584
|
let processEnv = process.env;
|
@@ -12555,8 +12589,10 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_m
|
|
12555
12589
|
function configDotenv(options$1) {
|
12556
12590
|
const dotenvPath = path$10.resolve(process.cwd(), ".env");
|
12557
12591
|
let encoding = "utf8";
|
12558
|
-
|
12559
|
-
|
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);
|
12560
12596
|
if (options$1 && options$1.encoding) encoding = options$1.encoding;
|
12561
12597
|
else if (debug$19) _debug("No encoding is specified. UTF-8 is used by default");
|
12562
12598
|
let optionPaths = [dotenvPath];
|
@@ -12574,9 +12610,9 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_m
|
|
12574
12610
|
if (debug$19) _debug(`Failed to load ${path$13} ${e$1.message}`);
|
12575
12611
|
lastError = e$1;
|
12576
12612
|
}
|
12577
|
-
let processEnv = process.env;
|
12578
|
-
if (options$1 && options$1.processEnv != null) processEnv = options$1.processEnv;
|
12579
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);
|
12580
12616
|
if (debug$19 || !quiet) {
|
12581
12617
|
const keysCount = Object.keys(populated).length;
|
12582
12618
|
const shortPaths = [];
|
@@ -12587,7 +12623,7 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@17.0.1/node_m
|
|
12587
12623
|
if (debug$19) _debug(`Failed to load ${filePath} ${e$1.message}`);
|
12588
12624
|
lastError = e$1;
|
12589
12625
|
}
|
12590
|
-
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")}
|
12626
|
+
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`(tip: ${_getRandomTip()})`)}`);
|
12591
12627
|
}
|
12592
12628
|
if (lastError) return {
|
12593
12629
|
parsed: parsedAll,
|
@@ -13158,7 +13194,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13158
13194
|
* Module dependencies.
|
13159
13195
|
*/
|
13160
13196
|
var tty = require("tty");
|
13161
|
-
var util$
|
13197
|
+
var util$1 = require("util");
|
13162
13198
|
/**
|
13163
13199
|
* This is the Node.js implementation of `debug()`.
|
13164
13200
|
*
|
@@ -13208,7 +13244,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13208
13244
|
* $ DEBUG_FD=3 node script.js 3>debug.log
|
13209
13245
|
*/
|
13210
13246
|
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
13211
|
-
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)")();
|
13212
13248
|
var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);
|
13213
13249
|
/**
|
13214
13250
|
* Is stdout a TTY? Colored output is enabled when `true`.
|
@@ -13221,7 +13257,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13221
13257
|
*/
|
13222
13258
|
exports.formatters.o = function(v) {
|
13223
13259
|
this.inspectOpts.colors = this.useColors;
|
13224
|
-
return util$
|
13260
|
+
return util$1.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
13225
13261
|
return str.trim();
|
13226
13262
|
}).join(" ");
|
13227
13263
|
};
|
@@ -13230,7 +13266,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13230
13266
|
*/
|
13231
13267
|
exports.formatters.O = function(v) {
|
13232
13268
|
this.inspectOpts.colors = this.useColors;
|
13233
|
-
return util$
|
13269
|
+
return util$1.inspect(v, this.inspectOpts);
|
13234
13270
|
};
|
13235
13271
|
/**
|
13236
13272
|
* Adds ANSI color escape codes if enabled.
|
@@ -13251,7 +13287,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13251
13287
|
* Invokes `util.format()` with the specified arguments and writes to `stream`.
|
13252
13288
|
*/
|
13253
13289
|
function log() {
|
13254
|
-
return stream.write(util$
|
13290
|
+
return stream.write(util$1.format.apply(util$1, arguments) + "\n");
|
13255
13291
|
}
|
13256
13292
|
/**
|
13257
13293
|
* Save `namespaces`.
|
@@ -15500,7 +15536,7 @@ var require_to_regex_range = __commonJS({ "../../node_modules/.pnpm/to-regex-ran
|
|
15500
15536
|
//#endregion
|
15501
15537
|
//#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
|
15502
15538
|
var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js"(exports, module) {
|
15503
|
-
const util
|
15539
|
+
const util = require("util");
|
15504
15540
|
const toRegexRange = require_to_regex_range();
|
15505
15541
|
const isObject$1 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
15506
15542
|
const transform$1 = (toNumber) => {
|
@@ -15573,7 +15609,7 @@ var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1
|
|
15573
15609
|
return toRegexRange(start, end, options$1);
|
15574
15610
|
};
|
15575
15611
|
const rangeError = (...args) => {
|
15576
|
-
return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util
|
15612
|
+
return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util.inspect(...args));
|
15577
15613
|
};
|
15578
15614
|
const invalidRange = (start, end, options$1) => {
|
15579
15615
|
if (options$1.strictRanges === true) throw rangeError([start, end]);
|
@@ -19451,6 +19487,37 @@ const isWsl = () => {
|
|
19451
19487
|
};
|
19452
19488
|
var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
19453
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
|
+
|
19454
19521
|
//#endregion
|
19455
19522
|
//#region ../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
|
19456
19523
|
function defineLazyProperty(object, propertyName, valueGetter) {
|
@@ -19596,54 +19663,19 @@ async function defaultBrowser() {
|
|
19596
19663
|
}
|
19597
19664
|
|
19598
19665
|
//#endregion
|
19599
|
-
//#region ../../node_modules/.pnpm/open@10.
|
19600
|
-
const execFile$1 =
|
19666
|
+
//#region ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
|
19667
|
+
const execFile$1 = promisify(childProcess.execFile);
|
19601
19668
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
19602
19669
|
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
19603
19670
|
const { platform, arch } = process$1;
|
19604
19671
|
/**
|
19605
|
-
Get the mount point for fixed drives in WSL.
|
19606
|
-
|
19607
|
-
@inner
|
19608
|
-
@returns {string} The mount point.
|
19609
|
-
*/
|
19610
|
-
const getWslDrivesMountPoint = (() => {
|
19611
|
-
const defaultMountPoint = "/mnt/";
|
19612
|
-
let mountPoint;
|
19613
|
-
return async function() {
|
19614
|
-
if (mountPoint) return mountPoint;
|
19615
|
-
const configFilePath = "/etc/wsl.conf";
|
19616
|
-
let isConfigFileExists = false;
|
19617
|
-
try {
|
19618
|
-
await fsp.access(configFilePath, constants.F_OK);
|
19619
|
-
isConfigFileExists = true;
|
19620
|
-
} catch {}
|
19621
|
-
if (!isConfigFileExists) return defaultMountPoint;
|
19622
|
-
const configContent = await fsp.readFile(configFilePath, { encoding: "utf8" });
|
19623
|
-
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
19624
|
-
if (!configMountPoint) return defaultMountPoint;
|
19625
|
-
mountPoint = configMountPoint.groups.mountPoint.trim();
|
19626
|
-
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
19627
|
-
return mountPoint;
|
19628
|
-
};
|
19629
|
-
})();
|
19630
|
-
/**
|
19631
|
-
Get the PowerShell executable path in WSL environment.
|
19632
|
-
|
19633
|
-
@returns {Promise<string>} The absolute path to the PowerShell executable in WSL.
|
19634
|
-
*/
|
19635
|
-
const getPowershellPathFromWsl = async () => {
|
19636
|
-
const mountPoint = await getWslDrivesMountPoint();
|
19637
|
-
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
19638
|
-
};
|
19639
|
-
/**
|
19640
19672
|
Get the default browser name in Windows from WSL.
|
19641
19673
|
|
19642
19674
|
@returns {Promise<string>} Browser name.
|
19643
19675
|
*/
|
19644
19676
|
async function getWindowsDefaultBrowserFromWsl() {
|
19645
|
-
const powershellPath = await
|
19646
|
-
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`;
|
19647
19679
|
const encodedCommand = Buffer$1.from(rawCommand, "utf16le").toString("base64");
|
19648
19680
|
const { stdout } = await execFile$1(powershellPath, [
|
19649
19681
|
"-NoProfile",
|
@@ -19656,6 +19688,7 @@ async function getWindowsDefaultBrowserFromWsl() {
|
|
19656
19688
|
const progId = stdout.trim();
|
19657
19689
|
const browserMap = {
|
19658
19690
|
ChromeHTML: "com.google.chrome",
|
19691
|
+
BraveHTML: "com.brave.Browser",
|
19659
19692
|
MSEdgeHTM: "com.microsoft.edge",
|
19660
19693
|
FirefoxURL: "org.mozilla.firefox"
|
19661
19694
|
};
|
@@ -19695,6 +19728,7 @@ const baseOpen = async (options$1) => {
|
|
19695
19728
|
const ids = {
|
19696
19729
|
"com.google.chrome": "chrome",
|
19697
19730
|
"google-chrome.desktop": "chrome",
|
19731
|
+
"com.brave.Browser": "brave",
|
19698
19732
|
"org.mozilla.firefox": "firefox",
|
19699
19733
|
"firefox.desktop": "firefox",
|
19700
19734
|
"com.microsoft.msedge": "edge",
|
@@ -19704,6 +19738,7 @@ const baseOpen = async (options$1) => {
|
|
19704
19738
|
};
|
19705
19739
|
const flags = {
|
19706
19740
|
chrome: "--incognito",
|
19741
|
+
brave: "--incognito",
|
19707
19742
|
firefox: "--private-window",
|
19708
19743
|
edge: "--inPrivate"
|
19709
19744
|
};
|
@@ -19731,7 +19766,7 @@ const baseOpen = async (options$1) => {
|
|
19731
19766
|
if (options$1.newInstance) cliArguments.push("--new");
|
19732
19767
|
if (app) cliArguments.push("-a", app);
|
19733
19768
|
} else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
|
19734
|
-
command =
|
19769
|
+
command = await powerShellPath();
|
19735
19770
|
cliArguments.push("-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand");
|
19736
19771
|
if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
|
19737
19772
|
const encodedArguments = ["Start"];
|
@@ -19810,9 +19845,17 @@ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
19810
19845
|
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
19811
19846
|
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
19812
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
|
+
} }));
|
19813
19856
|
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
19814
19857
|
darwin: "firefox",
|
19815
|
-
win32:
|
19858
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
19816
19859
|
linux: "firefox"
|
19817
19860
|
}, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
|
19818
19861
|
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
@@ -26296,9 +26339,8 @@ function transformRequest(environment, url$6, options$1 = {}) {
|
|
26296
26339
|
ssr: environment.config.consumer === "server"
|
26297
26340
|
};
|
26298
26341
|
if (environment._closing && environment.config.dev.recoverable) throwClosedServerError();
|
26299
|
-
const cacheKey = `${options$1.html ? "html:" : ""}${url$6}`;
|
26300
26342
|
const timestamp = monotonicDateNow();
|
26301
|
-
const pending = environment._pendingRequests.get(
|
26343
|
+
const pending = environment._pendingRequests.get(url$6);
|
26302
26344
|
if (pending) return environment.moduleGraph.getModuleByUrl(removeTimestampQuery(url$6)).then((module$1) => {
|
26303
26345
|
if (!module$1 || pending.timestamp > module$1.lastInvalidationTimestamp) return pending.request;
|
26304
26346
|
else {
|
@@ -26310,11 +26352,11 @@ function transformRequest(environment, url$6, options$1 = {}) {
|
|
26310
26352
|
let cleared = false;
|
26311
26353
|
const clearCache = () => {
|
26312
26354
|
if (!cleared) {
|
26313
|
-
environment._pendingRequests.delete(
|
26355
|
+
environment._pendingRequests.delete(url$6);
|
26314
26356
|
cleared = true;
|
26315
26357
|
}
|
26316
26358
|
};
|
26317
|
-
environment._pendingRequests.set(
|
26359
|
+
environment._pendingRequests.set(url$6, {
|
26318
26360
|
request,
|
26319
26361
|
timestamp,
|
26320
26362
|
abort: clearCache
|
@@ -26370,16 +26412,12 @@ async function loadAndTransform(environment, id, url$6, options$1, timestamp, mo
|
|
26370
26412
|
const loadResult = await pluginContainer.load(id);
|
26371
26413
|
if (loadResult == null) {
|
26372
26414
|
const file = cleanUrl(id);
|
26373
|
-
if (options$1.html && !id.endsWith(".html")) return null;
|
26374
26415
|
if (environment.config.consumer === "server" || isFileLoadingAllowed(environment.getTopLevelConfig(), file)) {
|
26375
26416
|
try {
|
26376
26417
|
code = await fsp.readFile(file, "utf-8");
|
26377
26418
|
debugLoad?.(`${timeFrom(loadStart)} [fs] ${prettyUrl}`);
|
26378
26419
|
} catch (e$1) {
|
26379
|
-
if (e$1.code !== "ENOENT")
|
26380
|
-
if (e$1.code === "EISDIR") e$1.message = `${e$1.message} ${file}`;
|
26381
|
-
throw e$1;
|
26382
|
-
}
|
26420
|
+
if (e$1.code !== "ENOENT" && e$1.code !== "EISDIR") throw e$1;
|
26383
26421
|
}
|
26384
26422
|
if (code != null && environment.pluginContainer.watcher) ensureWatchedFile(environment.pluginContainer.watcher, file, config$2.root);
|
26385
26423
|
}
|
@@ -27498,12 +27536,9 @@ function transformMiddleware(server) {
|
|
27498
27536
|
return res.end();
|
27499
27537
|
}
|
27500
27538
|
}
|
27501
|
-
const result = await transformRequest(environment, url$6, {
|
27502
|
-
|
27503
|
-
|
27504
|
-
return id.startsWith("\0") || !deniedServingAccessForTransform(id, server, res, next);
|
27505
|
-
}
|
27506
|
-
});
|
27539
|
+
const result = await transformRequest(environment, url$6, { allowId(id) {
|
27540
|
+
return id.startsWith("\0") || !deniedServingAccessForTransform(id, server, res, next);
|
27541
|
+
} });
|
27507
27542
|
if (result) {
|
27508
27543
|
const depsOptimizer = environment.depsOptimizer;
|
27509
27544
|
const type = isDirectCSSRequest(url$6) ? "css" : "js";
|
@@ -30587,7 +30622,10 @@ function assetImportMetaUrlPlugin(config$2) {
|
|
30587
30622
|
if (publicDir && isParentDirectory(publicDir, file)) {
|
30588
30623
|
const publicPath = "/" + path.posix.relative(publicDir, file);
|
30589
30624
|
builtUrl = await fileToUrl$1(this, publicPath);
|
30590
|
-
} else
|
30625
|
+
} else {
|
30626
|
+
this.addWatchFile(file);
|
30627
|
+
builtUrl = await fileToUrl$1(this, file);
|
30628
|
+
}
|
30591
30629
|
} catch {}
|
30592
30630
|
if (!builtUrl) {
|
30593
30631
|
const rawExp = code.slice(startIndex, endIndex);
|
@@ -30893,7 +30931,7 @@ function createFilterForTransform(idFilter, codeFilter, cwd) {
|
|
30893
30931
|
async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins) {
|
30894
30932
|
const isBuild = config$2.command === "build";
|
30895
30933
|
const isWorker = config$2.isWorker;
|
30896
|
-
const buildPlugins = isBuild ? await (await import("./dep-
|
30934
|
+
const buildPlugins = isBuild ? await (await import("./dep-EUZWNfwr.js")).resolveBuildPlugins(config$2) : {
|
30897
30935
|
pre: [],
|
30898
30936
|
post: []
|
30899
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,8 +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/
|
86
|
-
"@oxc-project/types": "0.75.1",
|
85
|
+
"@oxc-project/types": "0.77.0",
|
87
86
|
"@polka/compression": "^1.0.0-next.25",
|
88
87
|
"@rollup/plugin-alias": "^5.1.1",
|
89
88
|
"@rollup/plugin-commonjs": "^28.0.6",
|
@@ -92,7 +91,7 @@
|
|
92
91
|
"@types/escape-html": "^1.0.4",
|
93
92
|
"@types/pnpapi": "^0.0.5",
|
94
93
|
"artichokie": "^0.3.2",
|
95
|
-
"baseline-browser-mapping": "^2.
|
94
|
+
"baseline-browser-mapping": "^2.5.3",
|
96
95
|
"cac": "^6.7.14",
|
97
96
|
"chokidar": "^3.6.0",
|
98
97
|
"connect": "^3.7.0",
|
@@ -101,7 +100,7 @@
|
|
101
100
|
"cross-spawn": "^7.0.6",
|
102
101
|
"debug": "^4.4.1",
|
103
102
|
"dep-types": "link:./src/types",
|
104
|
-
"dotenv": "^17.0
|
103
|
+
"dotenv": "^17.2.0",
|
105
104
|
"dotenv-expand": "^12.0.2",
|
106
105
|
"es-module-lexer": "^1.7.0",
|
107
106
|
"escape-html": "^1.0.3",
|
@@ -115,7 +114,7 @@
|
|
115
114
|
"mlly": "^1.7.4",
|
116
115
|
"mrmime": "^2.0.1",
|
117
116
|
"nanoid": "^5.1.5",
|
118
|
-
"open": "^10.
|
117
|
+
"open": "^10.2.0",
|
119
118
|
"parse5": "^7.3.0",
|
120
119
|
"pathe": "^2.0.3",
|
121
120
|
"periscopic": "^4.0.2",
|
@@ -125,7 +124,7 @@
|
|
125
124
|
"postcss-modules": "^6.0.1",
|
126
125
|
"premove": "^4.0.0",
|
127
126
|
"resolve.exports": "^2.0.3",
|
128
|
-
"rolldown": "^1.0.0-beta.
|
127
|
+
"rolldown": "^1.0.0-beta.27",
|
129
128
|
"rolldown-plugin-dts": "^0.13.13",
|
130
129
|
"rollup-plugin-license": "^3.6.0",
|
131
130
|
"sass": "^1.89.2",
|