vite 5.0.0-beta.2 → 5.0.0-beta.20
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 +96 -39
- package/dist/client/client.mjs +34 -3
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-13ae786e.js → dep-M-BNPx05.js} +2 -2
- package/dist/node/chunks/{dep-82f73734.js → dep-T98iZFpD.js} +35023 -35691
- package/dist/node/chunks/{dep-5c5f3875.js → dep-_v8GkZ9b.js} +145 -145
- package/dist/node/cli.js +39 -38
- package/dist/node/constants.js +1 -0
- package/dist/node/index.d.ts +3315 -3502
- package/dist/node/index.js +9 -7
- package/dist/node-cjs/publicUtils.cjs +553 -500
- package/index.cjs +12 -9
- package/index.d.cts +6 -0
- package/package.json +43 -41
- package/types/hot.d.ts +4 -0
- package/types/import-meta.d.ts +5 -0
- /package/dist/node/chunks/{dep-c423598f.js → dep-8a-6Quh6.js} +0 -0
- /package/dist/node/chunks/{dep-f0c7dae0.js → dep-kjUoH5nk.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z as commonjsGlobal, y as getDefaultExportFromCjs } from './dep-T98iZFpD.js';
|
|
2
2
|
import require$$0__default from 'fs';
|
|
3
3
|
import require$$0 from 'postcss';
|
|
4
4
|
import require$$0$1 from 'path';
|
|
5
|
-
import require$$
|
|
6
|
-
import require$$0$
|
|
7
|
-
import { l as lib } from './dep-
|
|
5
|
+
import require$$0$2 from 'crypto';
|
|
6
|
+
import require$$0$3 from 'util';
|
|
7
|
+
import { l as lib } from './dep-8a-6Quh6.js';
|
|
8
8
|
|
|
9
9
|
import { fileURLToPath as __cjs_fileURLToPath } from 'node:url';
|
|
10
10
|
import { dirname as __cjs_dirname } from 'node:path';
|
|
@@ -1448,6 +1448,122 @@ src$3.exports.postcss = true;
|
|
|
1448
1448
|
|
|
1449
1449
|
var srcExports$2 = src$3.exports;
|
|
1450
1450
|
|
|
1451
|
+
var BulkUpdateDecorator_1;
|
|
1452
|
+
var hasRequiredBulkUpdateDecorator;
|
|
1453
|
+
|
|
1454
|
+
function requireBulkUpdateDecorator () {
|
|
1455
|
+
if (hasRequiredBulkUpdateDecorator) return BulkUpdateDecorator_1;
|
|
1456
|
+
hasRequiredBulkUpdateDecorator = 1;
|
|
1457
|
+
const BULK_SIZE = 2000;
|
|
1458
|
+
|
|
1459
|
+
// We are using an object instead of a Map as this will stay static during the runtime
|
|
1460
|
+
// so access to it can be optimized by v8
|
|
1461
|
+
const digestCaches = {};
|
|
1462
|
+
|
|
1463
|
+
class BulkUpdateDecorator {
|
|
1464
|
+
/**
|
|
1465
|
+
* @param {Hash | function(): Hash} hashOrFactory function to create a hash
|
|
1466
|
+
* @param {string=} hashKey key for caching
|
|
1467
|
+
*/
|
|
1468
|
+
constructor(hashOrFactory, hashKey) {
|
|
1469
|
+
this.hashKey = hashKey;
|
|
1470
|
+
|
|
1471
|
+
if (typeof hashOrFactory === "function") {
|
|
1472
|
+
this.hashFactory = hashOrFactory;
|
|
1473
|
+
this.hash = undefined;
|
|
1474
|
+
} else {
|
|
1475
|
+
this.hashFactory = undefined;
|
|
1476
|
+
this.hash = hashOrFactory;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
this.buffer = "";
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
/**
|
|
1483
|
+
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
|
|
1484
|
+
* @param {string|Buffer} data data
|
|
1485
|
+
* @param {string=} inputEncoding data encoding
|
|
1486
|
+
* @returns {this} updated hash
|
|
1487
|
+
*/
|
|
1488
|
+
update(data, inputEncoding) {
|
|
1489
|
+
if (
|
|
1490
|
+
inputEncoding !== undefined ||
|
|
1491
|
+
typeof data !== "string" ||
|
|
1492
|
+
data.length > BULK_SIZE
|
|
1493
|
+
) {
|
|
1494
|
+
if (this.hash === undefined) {
|
|
1495
|
+
this.hash = this.hashFactory();
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
if (this.buffer.length > 0) {
|
|
1499
|
+
this.hash.update(this.buffer);
|
|
1500
|
+
this.buffer = "";
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
this.hash.update(data, inputEncoding);
|
|
1504
|
+
} else {
|
|
1505
|
+
this.buffer += data;
|
|
1506
|
+
|
|
1507
|
+
if (this.buffer.length > BULK_SIZE) {
|
|
1508
|
+
if (this.hash === undefined) {
|
|
1509
|
+
this.hash = this.hashFactory();
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
this.hash.update(this.buffer);
|
|
1513
|
+
this.buffer = "";
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
return this;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
|
|
1522
|
+
* @param {string=} encoding encoding of the return value
|
|
1523
|
+
* @returns {string|Buffer} digest
|
|
1524
|
+
*/
|
|
1525
|
+
digest(encoding) {
|
|
1526
|
+
let digestCache;
|
|
1527
|
+
|
|
1528
|
+
const buffer = this.buffer;
|
|
1529
|
+
|
|
1530
|
+
if (this.hash === undefined) {
|
|
1531
|
+
// short data for hash, we can use caching
|
|
1532
|
+
const cacheKey = `${this.hashKey}-${encoding}`;
|
|
1533
|
+
|
|
1534
|
+
digestCache = digestCaches[cacheKey];
|
|
1535
|
+
|
|
1536
|
+
if (digestCache === undefined) {
|
|
1537
|
+
digestCache = digestCaches[cacheKey] = new Map();
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
const cacheEntry = digestCache.get(buffer);
|
|
1541
|
+
|
|
1542
|
+
if (cacheEntry !== undefined) {
|
|
1543
|
+
return cacheEntry;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
this.hash = this.hashFactory();
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
if (buffer.length > 0) {
|
|
1550
|
+
this.hash.update(buffer);
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
const digestResult = this.hash.digest(encoding);
|
|
1554
|
+
|
|
1555
|
+
if (digestCache !== undefined) {
|
|
1556
|
+
digestCache.set(buffer, digestResult);
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
return digestResult;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
BulkUpdateDecorator_1 = BulkUpdateDecorator;
|
|
1564
|
+
return BulkUpdateDecorator_1;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1451
1567
|
var wasmHash = {exports: {}};
|
|
1452
1568
|
|
|
1453
1569
|
/*
|
|
@@ -1670,27 +1786,27 @@ function requireWasmHash () {
|
|
|
1670
1786
|
Author Tobias Koppers @sokra
|
|
1671
1787
|
*/
|
|
1672
1788
|
|
|
1673
|
-
var
|
|
1674
|
-
var
|
|
1789
|
+
var md4_1;
|
|
1790
|
+
var hasRequiredMd4;
|
|
1675
1791
|
|
|
1676
|
-
function
|
|
1677
|
-
if (
|
|
1678
|
-
|
|
1792
|
+
function requireMd4 () {
|
|
1793
|
+
if (hasRequiredMd4) return md4_1;
|
|
1794
|
+
hasRequiredMd4 = 1;
|
|
1679
1795
|
|
|
1680
1796
|
const create = requireWasmHash();
|
|
1681
1797
|
|
|
1682
|
-
//#region wasm code:
|
|
1683
|
-
const
|
|
1798
|
+
//#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1
|
|
1799
|
+
const md4 = new WebAssembly.Module(
|
|
1684
1800
|
Buffer.from(
|
|
1685
|
-
//
|
|
1686
|
-
"
|
|
1801
|
+
// 2150 bytes
|
|
1802
|
+
"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",
|
|
1687
1803
|
"base64"
|
|
1688
1804
|
)
|
|
1689
1805
|
);
|
|
1690
1806
|
//#endregion
|
|
1691
1807
|
|
|
1692
|
-
|
|
1693
|
-
return
|
|
1808
|
+
md4_1 = create.bind(null, md4, [], 64, 32);
|
|
1809
|
+
return md4_1;
|
|
1694
1810
|
}
|
|
1695
1811
|
|
|
1696
1812
|
var BatchedHash_1;
|
|
@@ -1771,143 +1887,27 @@ function requireBatchedHash () {
|
|
|
1771
1887
|
Author Tobias Koppers @sokra
|
|
1772
1888
|
*/
|
|
1773
1889
|
|
|
1774
|
-
var
|
|
1775
|
-
var
|
|
1890
|
+
var xxhash64_1;
|
|
1891
|
+
var hasRequiredXxhash64;
|
|
1776
1892
|
|
|
1777
|
-
function
|
|
1778
|
-
if (
|
|
1779
|
-
|
|
1893
|
+
function requireXxhash64 () {
|
|
1894
|
+
if (hasRequiredXxhash64) return xxhash64_1;
|
|
1895
|
+
hasRequiredXxhash64 = 1;
|
|
1780
1896
|
|
|
1781
1897
|
const create = requireWasmHash();
|
|
1782
1898
|
|
|
1783
|
-
//#region wasm code:
|
|
1784
|
-
const
|
|
1899
|
+
//#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
|
|
1900
|
+
const xxhash64 = new WebAssembly.Module(
|
|
1785
1901
|
Buffer.from(
|
|
1786
|
-
//
|
|
1787
|
-
"
|
|
1902
|
+
// 1173 bytes
|
|
1903
|
+
"AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqwYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEACfyACIAE1AgBCh5Wvr5i23puef36FQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCECIAFBBGoLIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAiACQh2IhUL5893xmfaZqxZ+IgIgAkIgiIUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL",
|
|
1788
1904
|
"base64"
|
|
1789
1905
|
)
|
|
1790
1906
|
);
|
|
1791
1907
|
//#endregion
|
|
1792
1908
|
|
|
1793
|
-
|
|
1794
|
-
return
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
var BulkUpdateDecorator_1;
|
|
1798
|
-
var hasRequiredBulkUpdateDecorator;
|
|
1799
|
-
|
|
1800
|
-
function requireBulkUpdateDecorator () {
|
|
1801
|
-
if (hasRequiredBulkUpdateDecorator) return BulkUpdateDecorator_1;
|
|
1802
|
-
hasRequiredBulkUpdateDecorator = 1;
|
|
1803
|
-
const BULK_SIZE = 2000;
|
|
1804
|
-
|
|
1805
|
-
// We are using an object instead of a Map as this will stay static during the runtime
|
|
1806
|
-
// so access to it can be optimized by v8
|
|
1807
|
-
const digestCaches = {};
|
|
1808
|
-
|
|
1809
|
-
class BulkUpdateDecorator {
|
|
1810
|
-
/**
|
|
1811
|
-
* @param {Hash | function(): Hash} hashOrFactory function to create a hash
|
|
1812
|
-
* @param {string=} hashKey key for caching
|
|
1813
|
-
*/
|
|
1814
|
-
constructor(hashOrFactory, hashKey) {
|
|
1815
|
-
this.hashKey = hashKey;
|
|
1816
|
-
|
|
1817
|
-
if (typeof hashOrFactory === "function") {
|
|
1818
|
-
this.hashFactory = hashOrFactory;
|
|
1819
|
-
this.hash = undefined;
|
|
1820
|
-
} else {
|
|
1821
|
-
this.hashFactory = undefined;
|
|
1822
|
-
this.hash = hashOrFactory;
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
this.buffer = "";
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1828
|
-
/**
|
|
1829
|
-
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
|
|
1830
|
-
* @param {string|Buffer} data data
|
|
1831
|
-
* @param {string=} inputEncoding data encoding
|
|
1832
|
-
* @returns {this} updated hash
|
|
1833
|
-
*/
|
|
1834
|
-
update(data, inputEncoding) {
|
|
1835
|
-
if (
|
|
1836
|
-
inputEncoding !== undefined ||
|
|
1837
|
-
typeof data !== "string" ||
|
|
1838
|
-
data.length > BULK_SIZE
|
|
1839
|
-
) {
|
|
1840
|
-
if (this.hash === undefined) {
|
|
1841
|
-
this.hash = this.hashFactory();
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
if (this.buffer.length > 0) {
|
|
1845
|
-
this.hash.update(this.buffer);
|
|
1846
|
-
this.buffer = "";
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
|
-
this.hash.update(data, inputEncoding);
|
|
1850
|
-
} else {
|
|
1851
|
-
this.buffer += data;
|
|
1852
|
-
|
|
1853
|
-
if (this.buffer.length > BULK_SIZE) {
|
|
1854
|
-
if (this.hash === undefined) {
|
|
1855
|
-
this.hash = this.hashFactory();
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
this.hash.update(this.buffer);
|
|
1859
|
-
this.buffer = "";
|
|
1860
|
-
}
|
|
1861
|
-
}
|
|
1862
|
-
|
|
1863
|
-
return this;
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
/**
|
|
1867
|
-
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
|
|
1868
|
-
* @param {string=} encoding encoding of the return value
|
|
1869
|
-
* @returns {string|Buffer} digest
|
|
1870
|
-
*/
|
|
1871
|
-
digest(encoding) {
|
|
1872
|
-
let digestCache;
|
|
1873
|
-
|
|
1874
|
-
const buffer = this.buffer;
|
|
1875
|
-
|
|
1876
|
-
if (this.hash === undefined) {
|
|
1877
|
-
// short data for hash, we can use caching
|
|
1878
|
-
const cacheKey = `${this.hashKey}-${encoding}`;
|
|
1879
|
-
|
|
1880
|
-
digestCache = digestCaches[cacheKey];
|
|
1881
|
-
|
|
1882
|
-
if (digestCache === undefined) {
|
|
1883
|
-
digestCache = digestCaches[cacheKey] = new Map();
|
|
1884
|
-
}
|
|
1885
|
-
|
|
1886
|
-
const cacheEntry = digestCache.get(buffer);
|
|
1887
|
-
|
|
1888
|
-
if (cacheEntry !== undefined) {
|
|
1889
|
-
return cacheEntry;
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
this.hash = this.hashFactory();
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
if (buffer.length > 0) {
|
|
1896
|
-
this.hash.update(buffer);
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
const digestResult = this.hash.digest(encoding);
|
|
1900
|
-
|
|
1901
|
-
if (digestCache !== undefined) {
|
|
1902
|
-
digestCache.set(buffer, digestResult);
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
return digestResult;
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
BulkUpdateDecorator_1 = BulkUpdateDecorator;
|
|
1910
|
-
return BulkUpdateDecorator_1;
|
|
1909
|
+
xxhash64_1 = create.bind(null, xxhash64, [], 32, 16);
|
|
1910
|
+
return xxhash64_1;
|
|
1911
1911
|
}
|
|
1912
1912
|
|
|
1913
1913
|
const baseEncodeTables = {
|
|
@@ -1998,7 +1998,7 @@ function getHashDigest$1(buffer, algorithm, digestType, maxLength) {
|
|
|
1998
1998
|
hash = new BatchedHash(createMd4());
|
|
1999
1999
|
} else if (algorithm === "native-md4") {
|
|
2000
2000
|
if (typeof crypto === "undefined") {
|
|
2001
|
-
crypto = require$$
|
|
2001
|
+
crypto = require$$0$2;
|
|
2002
2002
|
|
|
2003
2003
|
if (BulkUpdateDecorator === undefined) {
|
|
2004
2004
|
BulkUpdateDecorator = requireBulkUpdateDecorator();
|
|
@@ -2008,7 +2008,7 @@ function getHashDigest$1(buffer, algorithm, digestType, maxLength) {
|
|
|
2008
2008
|
hash = new BulkUpdateDecorator(() => crypto.createHash("md4"), "md4");
|
|
2009
2009
|
} else {
|
|
2010
2010
|
if (typeof crypto === "undefined") {
|
|
2011
|
-
crypto = require$$
|
|
2011
|
+
crypto = require$$0$2;
|
|
2012
2012
|
|
|
2013
2013
|
if (BulkUpdateDecorator === undefined) {
|
|
2014
2014
|
BulkUpdateDecorator = requireBulkUpdateDecorator();
|
|
@@ -3694,7 +3694,7 @@ var attribute$1 = {};
|
|
|
3694
3694
|
* For Node.js, simply re-export the core `util.deprecate` function.
|
|
3695
3695
|
*/
|
|
3696
3696
|
|
|
3697
|
-
var node = require$$0$
|
|
3697
|
+
var node = require$$0$3.deprecate;
|
|
3698
3698
|
|
|
3699
3699
|
(function (exports) {
|
|
3700
3700
|
|
package/dist/node/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { performance } from 'node:perf_hooks';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
|
-
import {
|
|
5
|
+
import { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-T98iZFpD.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -13,6 +13,8 @@ import 'esbuild';
|
|
|
13
13
|
import 'path';
|
|
14
14
|
import 'fs';
|
|
15
15
|
import 'assert';
|
|
16
|
+
import 'node:http';
|
|
17
|
+
import 'node:https';
|
|
16
18
|
import 'util';
|
|
17
19
|
import 'net';
|
|
18
20
|
import 'url';
|
|
@@ -31,16 +33,16 @@ import 'node:assert';
|
|
|
31
33
|
import 'node:process';
|
|
32
34
|
import 'node:v8';
|
|
33
35
|
import 'rollup';
|
|
34
|
-
import '
|
|
35
|
-
import '
|
|
36
|
+
import 'rollup/parseAst';
|
|
37
|
+
import 'querystring';
|
|
38
|
+
import 'node:readline';
|
|
39
|
+
import 'node:events';
|
|
36
40
|
import 'zlib';
|
|
37
41
|
import 'buffer';
|
|
38
42
|
import 'https';
|
|
39
43
|
import 'tls';
|
|
40
|
-
import 'worker_threads';
|
|
41
|
-
import 'querystring';
|
|
42
|
-
import 'node:readline';
|
|
43
44
|
import 'node:zlib';
|
|
45
|
+
import 'worker_threads';
|
|
44
46
|
|
|
45
47
|
function toArr(any) {
|
|
46
48
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -749,7 +751,6 @@ cli
|
|
|
749
751
|
.alias('dev') // alias to align with the script name
|
|
750
752
|
.option('--host [host]', `[string] specify hostname`, { type: [convertHost] })
|
|
751
753
|
.option('--port <port>', `[number] specify port`)
|
|
752
|
-
.option('--https', `[boolean] use TLS + HTTP/2`)
|
|
753
754
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
|
754
755
|
.option('--cors', `[boolean] enable CORS`)
|
|
755
756
|
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
|
@@ -758,7 +759,7 @@ cli
|
|
|
758
759
|
filterDuplicateOptions(options);
|
|
759
760
|
// output structure is preserved even after bundling so require()
|
|
760
761
|
// is ok here
|
|
761
|
-
const { createServer } = await import('./chunks/dep-
|
|
762
|
+
const { createServer } = await import('./chunks/dep-T98iZFpD.js').then(function (n) { return n.A; });
|
|
762
763
|
try {
|
|
763
764
|
const server = await createServer({
|
|
764
765
|
root,
|
|
@@ -779,35 +780,37 @@ cli
|
|
|
779
780
|
const startupDurationString = viteStartTime
|
|
780
781
|
? colors.dim(`ready in ${colors.reset(colors.bold(Math.ceil(performance.now() - viteStartTime)))} ms`)
|
|
781
782
|
: '';
|
|
782
|
-
|
|
783
|
+
const hasExistingLogs = process.stdout.bytesWritten > 0 || process.stderr.bytesWritten > 0;
|
|
784
|
+
info(`\n ${colors.green(`${colors.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, {
|
|
785
|
+
clear: !hasExistingLogs,
|
|
786
|
+
});
|
|
783
787
|
server.printUrls();
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
customShortcuts
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
profileSession.post('Profiler.
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
res();
|
|
803
|
-
});
|
|
788
|
+
const customShortcuts = [];
|
|
789
|
+
if (profileSession) {
|
|
790
|
+
customShortcuts.push({
|
|
791
|
+
key: 'p',
|
|
792
|
+
description: 'start/stop the profiler',
|
|
793
|
+
async action(server) {
|
|
794
|
+
if (profileSession) {
|
|
795
|
+
await stopProfiler(server.config.logger.info);
|
|
796
|
+
}
|
|
797
|
+
else {
|
|
798
|
+
const inspector = await import('node:inspector').then((r) => r.default);
|
|
799
|
+
await new Promise((res) => {
|
|
800
|
+
profileSession = new inspector.Session();
|
|
801
|
+
profileSession.connect();
|
|
802
|
+
profileSession.post('Profiler.enable', () => {
|
|
803
|
+
profileSession.post('Profiler.start', () => {
|
|
804
|
+
server.config.logger.info('Profiler started');
|
|
805
|
+
res();
|
|
804
806
|
});
|
|
805
807
|
});
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
+
});
|
|
809
|
+
}
|
|
808
810
|
},
|
|
809
|
-
|
|
810
|
-
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
server.bindCLIShortcuts({ print: true, customShortcuts });
|
|
811
814
|
}
|
|
812
815
|
catch (e) {
|
|
813
816
|
const logger = createLogger(options.logLevel);
|
|
@@ -836,7 +839,7 @@ cli
|
|
|
836
839
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
837
840
|
.action(async (root, options) => {
|
|
838
841
|
filterDuplicateOptions(options);
|
|
839
|
-
const { build } = await import('./chunks/dep-
|
|
842
|
+
const { build } = await import('./chunks/dep-T98iZFpD.js').then(function (n) { return n.C; });
|
|
840
843
|
const buildOptions = cleanOptions(options);
|
|
841
844
|
try {
|
|
842
845
|
await build({
|
|
@@ -864,7 +867,7 @@ cli
|
|
|
864
867
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
865
868
|
.action(async (root, options) => {
|
|
866
869
|
filterDuplicateOptions(options);
|
|
867
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
870
|
+
const { optimizeDeps } = await import('./chunks/dep-T98iZFpD.js').then(function (n) { return n.B; });
|
|
868
871
|
try {
|
|
869
872
|
const config = await resolveConfig({
|
|
870
873
|
root,
|
|
@@ -886,12 +889,11 @@ cli
|
|
|
886
889
|
.option('--host [host]', `[string] specify hostname`, { type: [convertHost] })
|
|
887
890
|
.option('--port <port>', `[number] specify port`)
|
|
888
891
|
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
|
889
|
-
.option('--https', `[boolean] use TLS + HTTP/2`)
|
|
890
892
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
|
891
893
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
892
894
|
.action(async (root, options) => {
|
|
893
895
|
filterDuplicateOptions(options);
|
|
894
|
-
const { preview } = await import('./chunks/dep-
|
|
896
|
+
const { preview } = await import('./chunks/dep-T98iZFpD.js').then(function (n) { return n.D; });
|
|
895
897
|
try {
|
|
896
898
|
const server = await preview({
|
|
897
899
|
root,
|
|
@@ -906,7 +908,6 @@ cli
|
|
|
906
908
|
port: options.port,
|
|
907
909
|
strictPort: options.strictPort,
|
|
908
910
|
host: options.host,
|
|
909
|
-
https: options.https,
|
|
910
911
|
open: options.open,
|
|
911
912
|
},
|
|
912
913
|
});
|
package/dist/node/constants.js
CHANGED