vite 3.2.3 → 4.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/chunks/{dep-9deb2354.js → dep-4ec4968a.js} +2 -2
- package/dist/node/chunks/{dep-7591464a.js → dep-6d760e82.js} +3 -3
- package/dist/node/chunks/{dep-51c4f80a.js → dep-7d777026.js} +256 -159
- package/dist/node/chunks/{dep-19c40c50.js → dep-adb60dd8.js} +0 -0
- package/dist/node/chunks/{dep-07a79996.js → dep-c423598f.js} +0 -0
- package/dist/node/cli.js +38 -8
- package/dist/node/constants.js +2 -2
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.js +1 -1
- package/dist/node-cjs/publicUtils.cjs +44 -54
- package/package.json +7 -7
|
File without changes
|
|
File without changes
|
package/dist/node/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
1
3
|
import { performance } from 'node:perf_hooks';
|
|
2
4
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-7d777026.js';
|
|
4
6
|
import { VERSION } from './constants.js';
|
|
5
|
-
import 'node:fs';
|
|
6
|
-
import 'node:path';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'node:module';
|
|
9
9
|
import 'tty';
|
|
@@ -651,6 +651,23 @@ class CAC extends EventEmitter {
|
|
|
651
651
|
const cac = (name = "") => new CAC(name);
|
|
652
652
|
|
|
653
653
|
const cli = cac('vite');
|
|
654
|
+
const stopProfiler = (log) => {
|
|
655
|
+
// @ts-ignore
|
|
656
|
+
const profileSession = global.__vite_profile_session;
|
|
657
|
+
if (profileSession) {
|
|
658
|
+
profileSession.post('Profiler.stop', (err, { profile }) => {
|
|
659
|
+
// Write profile to disk, upload, etc.
|
|
660
|
+
if (!err) {
|
|
661
|
+
const outPath = path.resolve('./vite-profile.cpuprofile');
|
|
662
|
+
fs.writeFileSync(outPath, JSON.stringify(profile));
|
|
663
|
+
log(picocolors.exports.yellow(`CPU profile written to ${picocolors.exports.white(picocolors.exports.dim(outPath))}`));
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
throw err;
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
};
|
|
654
671
|
const filterDuplicateOptions = (options) => {
|
|
655
672
|
for (const [key, value] of Object.entries(options)) {
|
|
656
673
|
if (Array.isArray(value)) {
|
|
@@ -702,7 +719,7 @@ cli
|
|
|
702
719
|
filterDuplicateOptions(options);
|
|
703
720
|
// output structure is preserved even after bundling so require()
|
|
704
721
|
// is ok here
|
|
705
|
-
const { createServer } = await import('./chunks/dep-
|
|
722
|
+
const { createServer } = await import('./chunks/dep-7d777026.js').then(function (n) { return n.D; });
|
|
706
723
|
try {
|
|
707
724
|
const server = await createServer({
|
|
708
725
|
root,
|
|
@@ -726,9 +743,14 @@ cli
|
|
|
726
743
|
: '';
|
|
727
744
|
info(`\n ${picocolors.exports.green(`${picocolors.exports.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, { clear: !server.config.logger.hasWarned });
|
|
728
745
|
server.printUrls();
|
|
746
|
+
stopProfiler((message) => server.config.logger.info(` ${message}`));
|
|
729
747
|
}
|
|
730
748
|
catch (e) {
|
|
731
|
-
createLogger(options.logLevel)
|
|
749
|
+
const logger = createLogger(options.logLevel);
|
|
750
|
+
logger.error(picocolors.exports.red(`error when starting dev server:\n${e.stack}`), {
|
|
751
|
+
error: e
|
|
752
|
+
});
|
|
753
|
+
stopProfiler(logger.info);
|
|
732
754
|
process.exit(1);
|
|
733
755
|
}
|
|
734
756
|
});
|
|
@@ -750,7 +772,7 @@ cli
|
|
|
750
772
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
751
773
|
.action(async (root, options) => {
|
|
752
774
|
filterDuplicateOptions(options);
|
|
753
|
-
const { build } = await import('./chunks/dep-
|
|
775
|
+
const { build } = await import('./chunks/dep-7d777026.js').then(function (n) { return n.C; });
|
|
754
776
|
const buildOptions = cleanOptions(options);
|
|
755
777
|
try {
|
|
756
778
|
await build({
|
|
@@ -768,6 +790,9 @@ cli
|
|
|
768
790
|
createLogger(options.logLevel).error(picocolors.exports.red(`error during build:\n${e.stack}`), { error: e });
|
|
769
791
|
process.exit(1);
|
|
770
792
|
}
|
|
793
|
+
finally {
|
|
794
|
+
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
|
795
|
+
}
|
|
771
796
|
});
|
|
772
797
|
// optimize
|
|
773
798
|
cli
|
|
@@ -775,7 +800,7 @@ cli
|
|
|
775
800
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
776
801
|
.action(async (root, options) => {
|
|
777
802
|
filterDuplicateOptions(options);
|
|
778
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
803
|
+
const { optimizeDeps } = await import('./chunks/dep-7d777026.js').then(function (n) { return n.B; });
|
|
779
804
|
try {
|
|
780
805
|
const config = await resolveConfig({
|
|
781
806
|
root,
|
|
@@ -800,7 +825,7 @@ cli
|
|
|
800
825
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
801
826
|
.action(async (root, options) => {
|
|
802
827
|
filterDuplicateOptions(options);
|
|
803
|
-
const { preview } = await import('./chunks/dep-
|
|
828
|
+
const { preview } = await import('./chunks/dep-7d777026.js').then(function (n) { return n.E; });
|
|
804
829
|
try {
|
|
805
830
|
const server = await preview({
|
|
806
831
|
root,
|
|
@@ -825,7 +850,12 @@ cli
|
|
|
825
850
|
createLogger(options.logLevel).error(picocolors.exports.red(`error when starting preview server:\n${e.stack}`), { error: e });
|
|
826
851
|
process.exit(1);
|
|
827
852
|
}
|
|
853
|
+
finally {
|
|
854
|
+
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
|
855
|
+
}
|
|
828
856
|
});
|
|
829
857
|
cli.help();
|
|
830
858
|
cli.version(VERSION);
|
|
831
859
|
cli.parse();
|
|
860
|
+
|
|
861
|
+
export { stopProfiler };
|
package/dist/node/constants.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path, { resolve } from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
const { version } = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)).toString());
|
|
6
6
|
const VERSION = version;
|
|
7
7
|
const DEFAULT_MAIN_FIELDS = [
|
|
8
8
|
'module',
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1493,6 +1493,7 @@ declare interface Plugin_2 extends Plugin_3 {
|
|
|
1493
1493
|
* extend hooks with ssr flag
|
|
1494
1494
|
*/
|
|
1495
1495
|
resolveId?: ObjectHook<(this: PluginContext, source: string, importer: string | undefined, options: {
|
|
1496
|
+
assertions: Record<string, string>;
|
|
1496
1497
|
custom?: CustomPluginOptions;
|
|
1497
1498
|
ssr?: boolean;
|
|
1498
1499
|
/* Excluded from this release type: scan */
|
|
@@ -1512,6 +1513,7 @@ export declare interface PluginContainer {
|
|
|
1512
1513
|
getModuleInfo(id: string): ModuleInfo | null;
|
|
1513
1514
|
buildStart(options: InputOptions): Promise<void>;
|
|
1514
1515
|
resolveId(id: string, importer?: string, options?: {
|
|
1516
|
+
assertions?: Record<string, string>;
|
|
1515
1517
|
custom?: CustomPluginOptions;
|
|
1516
1518
|
skip?: Set<Plugin_2>;
|
|
1517
1519
|
ssr?: boolean;
|
|
@@ -1624,6 +1626,7 @@ export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'asse
|
|
|
1624
1626
|
inlineConfig: InlineConfig;
|
|
1625
1627
|
root: string;
|
|
1626
1628
|
base: string;
|
|
1629
|
+
/* Excluded from this release type: rawBase */
|
|
1627
1630
|
publicDir: string;
|
|
1628
1631
|
cacheDir: string;
|
|
1629
1632
|
command: 'build' | 'serve';
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as build, q as createFilter, v as createLogger, c as createServer, e as defineConfig, f as formatPostcssSourceMap, i as getDepOptimizationConfig, j as isDepsOptimizerEnabled, l as loadConfigFromFile, x as loadEnv, k as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, h as resolveBaseUrl, g as resolveConfig, y as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
export { b as build, q as createFilter, v as createLogger, c as createServer, e as defineConfig, f as formatPostcssSourceMap, i as getDepOptimizationConfig, j as isDepsOptimizerEnabled, l as loadConfigFromFile, x as loadEnv, k as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, h as resolveBaseUrl, g as resolveConfig, y as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-7d777026.js';
|
|
2
2
|
export { VERSION as version } from './constants.js';
|
|
3
3
|
export { version as esbuildVersion } from 'esbuild';
|
|
4
4
|
export { VERSION as rollupVersion } from 'rollup';
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var path$3 = require('node:path');
|
|
6
4
|
var node_url = require('node:url');
|
|
5
|
+
var fs$1 = require('node:fs');
|
|
7
6
|
var esbuild = require('esbuild');
|
|
8
7
|
var rollup = require('rollup');
|
|
9
|
-
var fs$1 = require('node:fs');
|
|
10
8
|
var os$1 = require('node:os');
|
|
11
9
|
var node_util = require('node:util');
|
|
12
10
|
var node_module = require('node:module');
|
|
@@ -18,28 +16,14 @@ var require$$1$1 = require('fs');
|
|
|
18
16
|
var readline = require('node:readline');
|
|
19
17
|
var require$$2 = require('os');
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var path__default = /*#__PURE__*/_interopDefaultLegacy(path$3);
|
|
24
|
-
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs$1);
|
|
25
|
-
var os__default = /*#__PURE__*/_interopDefaultLegacy(os$1);
|
|
26
|
-
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
27
|
-
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
|
|
28
|
-
var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
|
|
29
|
-
var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
|
|
30
|
-
var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
|
|
31
|
-
var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
|
|
32
|
-
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
|
|
33
|
-
|
|
34
|
-
var version = "3.2.3";
|
|
35
|
-
|
|
19
|
+
const { version } = JSON.parse(fs$1.readFileSync(new URL('../../package.json', (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))).toString());
|
|
36
20
|
const VERSION = version;
|
|
37
21
|
const VITE_PACKAGE_DIR = path$3.resolve(
|
|
38
22
|
// import.meta.url is `dist/node/constants.js` after bundle
|
|
39
23
|
node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))), '../../..');
|
|
40
24
|
const CLIENT_ENTRY = path$3.resolve(VITE_PACKAGE_DIR, 'dist/client/client.mjs');
|
|
41
25
|
path$3.resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs');
|
|
42
|
-
|
|
26
|
+
path$3.dirname(CLIENT_ENTRY);
|
|
43
27
|
|
|
44
28
|
// This file will be built for both ESM and CJS. Avoid relying on other modules as possible.
|
|
45
29
|
const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
|
|
@@ -173,7 +157,7 @@ function getDefaultExportFromCjs (x) {
|
|
|
173
157
|
|
|
174
158
|
var picocolors = {exports: {}};
|
|
175
159
|
|
|
176
|
-
let tty = require$$
|
|
160
|
+
let tty = require$$0;
|
|
177
161
|
|
|
178
162
|
let isColorSupported =
|
|
179
163
|
!("NO_COLOR" in process.env || process.argv.includes("--no-color")) &&
|
|
@@ -980,8 +964,8 @@ function requireNode () {
|
|
|
980
964
|
if (hasRequiredNode) return node.exports;
|
|
981
965
|
hasRequiredNode = 1;
|
|
982
966
|
(function (module, exports) {
|
|
983
|
-
const tty = require$$
|
|
984
|
-
const util = require$$
|
|
967
|
+
const tty = require$$0;
|
|
968
|
+
const util = require$$1;
|
|
985
969
|
|
|
986
970
|
/**
|
|
987
971
|
* This is the Node.js implementation of `debug()`.
|
|
@@ -1262,7 +1246,7 @@ var picomatch$1 = {exports: {}};
|
|
|
1262
1246
|
|
|
1263
1247
|
var utils$3 = {};
|
|
1264
1248
|
|
|
1265
|
-
const path$2 = require$$
|
|
1249
|
+
const path$2 = require$$0$1;
|
|
1266
1250
|
const WIN_SLASH = '\\\\/';
|
|
1267
1251
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1268
1252
|
|
|
@@ -1442,7 +1426,7 @@ var constants$2 = {
|
|
|
1442
1426
|
|
|
1443
1427
|
(function (exports) {
|
|
1444
1428
|
|
|
1445
|
-
const path = require$$
|
|
1429
|
+
const path = require$$0$1;
|
|
1446
1430
|
const win32 = process.platform === 'win32';
|
|
1447
1431
|
const {
|
|
1448
1432
|
REGEX_BACKSLASH,
|
|
@@ -2979,7 +2963,7 @@ parse$2.fastpaths = (input, options) => {
|
|
|
2979
2963
|
|
|
2980
2964
|
var parse_1 = parse$2;
|
|
2981
2965
|
|
|
2982
|
-
const path$1 = require$$
|
|
2966
|
+
const path$1 = require$$0$1;
|
|
2983
2967
|
const scan = scan_1;
|
|
2984
2968
|
const parse$1 = parse_1;
|
|
2985
2969
|
const utils = utils$3;
|
|
@@ -3428,33 +3412,33 @@ function testCaseInsensitiveFS() {
|
|
|
3428
3412
|
if (!CLIENT_ENTRY.endsWith('client.mjs')) {
|
|
3429
3413
|
throw new Error(`cannot test case insensitive FS, CLIENT_ENTRY const doesn't contain client.mjs`);
|
|
3430
3414
|
}
|
|
3431
|
-
if (!
|
|
3415
|
+
if (!fs$1.existsSync(CLIENT_ENTRY)) {
|
|
3432
3416
|
throw new Error('cannot test case insensitive FS, CLIENT_ENTRY does not point to an existing file: ' +
|
|
3433
3417
|
CLIENT_ENTRY);
|
|
3434
3418
|
}
|
|
3435
|
-
return
|
|
3419
|
+
return fs$1.existsSync(CLIENT_ENTRY.replace('client.mjs', 'cLiEnT.mjs'));
|
|
3436
3420
|
}
|
|
3437
3421
|
testCaseInsensitiveFS();
|
|
3438
|
-
const isWindows =
|
|
3422
|
+
const isWindows = os$1.platform() === 'win32';
|
|
3439
3423
|
function normalizePath(id) {
|
|
3440
|
-
return
|
|
3424
|
+
return path$3.posix.normalize(isWindows ? slash(id) : id);
|
|
3441
3425
|
}
|
|
3442
3426
|
function isObject(value) {
|
|
3443
3427
|
return Object.prototype.toString.call(value) === '[object Object]';
|
|
3444
3428
|
}
|
|
3445
3429
|
function lookupFile(dir, formats, options) {
|
|
3446
3430
|
for (const format of formats) {
|
|
3447
|
-
const fullPath =
|
|
3448
|
-
if (
|
|
3431
|
+
const fullPath = path$3.join(dir, format);
|
|
3432
|
+
if (fs$1.existsSync(fullPath) && fs$1.statSync(fullPath).isFile()) {
|
|
3449
3433
|
const result = options?.pathOnly
|
|
3450
3434
|
? fullPath
|
|
3451
|
-
:
|
|
3435
|
+
: fs$1.readFileSync(fullPath, 'utf-8');
|
|
3452
3436
|
if (!options?.predicate || options.predicate(result)) {
|
|
3453
3437
|
return result;
|
|
3454
3438
|
}
|
|
3455
3439
|
}
|
|
3456
3440
|
}
|
|
3457
|
-
const parentDir =
|
|
3441
|
+
const parentDir = path$3.dirname(dir);
|
|
3458
3442
|
if (parentDir !== dir &&
|
|
3459
3443
|
(!options?.rootDir || parentDir.startsWith(options?.rootDir))) {
|
|
3460
3444
|
return lookupFile(parentDir, formats, options);
|
|
@@ -3468,7 +3452,7 @@ function lookupFile(dir, formats, options) {
|
|
|
3468
3452
|
*/
|
|
3469
3453
|
function isFileReadable(filename) {
|
|
3470
3454
|
try {
|
|
3471
|
-
const stat =
|
|
3455
|
+
const stat = fs$1.statSync(filename, { throwIfNoEntry: false });
|
|
3472
3456
|
return !!stat;
|
|
3473
3457
|
}
|
|
3474
3458
|
catch {
|
|
@@ -3478,9 +3462,9 @@ function isFileReadable(filename) {
|
|
|
3478
3462
|
isWindows
|
|
3479
3463
|
? node_util.promisify(gracefulRemoveDir)
|
|
3480
3464
|
: function removeDirSync(dir) {
|
|
3481
|
-
|
|
3465
|
+
fs$1.rmSync(dir, { recursive: true, force: true });
|
|
3482
3466
|
};
|
|
3483
|
-
isWindows ? node_util.promisify(gracefulRename) :
|
|
3467
|
+
isWindows ? node_util.promisify(gracefulRename) : fs$1.renameSync;
|
|
3484
3468
|
function arraify(target) {
|
|
3485
3469
|
return Array.isArray(target) ? target : [target];
|
|
3486
3470
|
}
|
|
@@ -3510,14 +3494,14 @@ const GRACEFUL_RENAME_TIMEOUT = 5000;
|
|
|
3510
3494
|
function gracefulRename(from, to, cb) {
|
|
3511
3495
|
const start = Date.now();
|
|
3512
3496
|
let backoff = 0;
|
|
3513
|
-
|
|
3497
|
+
fs$1.rename(from, to, function CB(er) {
|
|
3514
3498
|
if (er &&
|
|
3515
3499
|
(er.code === 'EACCES' || er.code === 'EPERM') &&
|
|
3516
3500
|
Date.now() - start < GRACEFUL_RENAME_TIMEOUT) {
|
|
3517
3501
|
setTimeout(function () {
|
|
3518
|
-
|
|
3502
|
+
fs$1.stat(to, function (stater, st) {
|
|
3519
3503
|
if (stater && stater.code === 'ENOENT')
|
|
3520
|
-
|
|
3504
|
+
fs$1.rename(from, to, CB);
|
|
3521
3505
|
else
|
|
3522
3506
|
CB(er);
|
|
3523
3507
|
});
|
|
@@ -3534,14 +3518,14 @@ const GRACEFUL_REMOVE_DIR_TIMEOUT = 5000;
|
|
|
3534
3518
|
function gracefulRemoveDir(dir, cb) {
|
|
3535
3519
|
const start = Date.now();
|
|
3536
3520
|
let backoff = 0;
|
|
3537
|
-
|
|
3521
|
+
fs$1.rm(dir, { recursive: true }, function CB(er) {
|
|
3538
3522
|
if (er) {
|
|
3539
3523
|
if ((er.code === 'ENOTEMPTY' ||
|
|
3540
3524
|
er.code === 'EACCES' ||
|
|
3541
3525
|
er.code === 'EPERM') &&
|
|
3542
3526
|
Date.now() - start < GRACEFUL_REMOVE_DIR_TIMEOUT) {
|
|
3543
3527
|
setTimeout(function () {
|
|
3544
|
-
|
|
3528
|
+
fs$1.rm(dir, { recursive: true }, CB);
|
|
3545
3529
|
}, backoff);
|
|
3546
3530
|
if (backoff < 100)
|
|
3547
3531
|
backoff += 10;
|
|
@@ -3654,8 +3638,8 @@ var etag_1 = etag;
|
|
|
3654
3638
|
* @private
|
|
3655
3639
|
*/
|
|
3656
3640
|
|
|
3657
|
-
var crypto = require$$
|
|
3658
|
-
var Stats = require$$
|
|
3641
|
+
var crypto = require$$0$2;
|
|
3642
|
+
var Stats = require$$1$1.Stats;
|
|
3659
3643
|
|
|
3660
3644
|
/**
|
|
3661
3645
|
* Module variables.
|
|
@@ -3838,8 +3822,8 @@ function clearScreen() {
|
|
|
3838
3822
|
const repeatCount = process.stdout.rows - 2;
|
|
3839
3823
|
const blank = repeatCount > 0 ? '\n'.repeat(repeatCount) : '';
|
|
3840
3824
|
console.log(blank);
|
|
3841
|
-
|
|
3842
|
-
|
|
3825
|
+
readline.cursorTo(process.stdout, 0, 0);
|
|
3826
|
+
readline.clearScreenDown(process.stdout);
|
|
3843
3827
|
}
|
|
3844
3828
|
function createLogger(level = 'info', options = {}) {
|
|
3845
3829
|
if (options.customLogger) {
|
|
@@ -3943,15 +3927,15 @@ function hasWorkspacePackageJSON(root) {
|
|
|
3943
3927
|
if (!isFileReadable(path)) {
|
|
3944
3928
|
return false;
|
|
3945
3929
|
}
|
|
3946
|
-
const content = JSON.parse(
|
|
3930
|
+
const content = JSON.parse(fs$1.readFileSync(path, 'utf-8')) || {};
|
|
3947
3931
|
return !!content.workspaces;
|
|
3948
3932
|
}
|
|
3949
3933
|
function hasRootFile(root) {
|
|
3950
|
-
return ROOT_FILES.some((file) =>
|
|
3934
|
+
return ROOT_FILES.some((file) => fs$1.existsSync(path$3.join(root, file)));
|
|
3951
3935
|
}
|
|
3952
3936
|
function hasPackageJSON(root) {
|
|
3953
3937
|
const path = path$3.join(root, 'package.json');
|
|
3954
|
-
return
|
|
3938
|
+
return fs$1.existsSync(path);
|
|
3955
3939
|
}
|
|
3956
3940
|
/**
|
|
3957
3941
|
* Search up for the nearest `package.json`
|
|
@@ -3982,9 +3966,9 @@ function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
|
|
3982
3966
|
|
|
3983
3967
|
var main$1 = {exports: {}};
|
|
3984
3968
|
|
|
3985
|
-
const fs = require$$
|
|
3986
|
-
const path = require$$
|
|
3987
|
-
const os = require$$
|
|
3969
|
+
const fs = require$$1$1;
|
|
3970
|
+
const path = require$$0$1;
|
|
3971
|
+
const os = require$$2;
|
|
3988
3972
|
|
|
3989
3973
|
function log (message) {
|
|
3990
3974
|
console.log(`[dotenv][DEBUG] ${message}`);
|
|
@@ -4190,15 +4174,21 @@ function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
|
4190
4174
|
});
|
|
4191
4175
|
if (!path)
|
|
4192
4176
|
return [];
|
|
4193
|
-
return Object.entries(main$1.exports.parse(
|
|
4177
|
+
return Object.entries(main$1.exports.parse(fs$1.readFileSync(path), {
|
|
4194
4178
|
debug: process.env.DEBUG?.includes('vite:dotenv')
|
|
4195
4179
|
}));
|
|
4196
4180
|
}));
|
|
4197
4181
|
// let environment variables use each other
|
|
4198
|
-
main({
|
|
4199
|
-
parsed
|
|
4182
|
+
const expandParsed = main({
|
|
4183
|
+
parsed: {
|
|
4184
|
+
...process.env,
|
|
4185
|
+
...parsed
|
|
4186
|
+
},
|
|
4200
4187
|
// prevent process.env mutation
|
|
4201
4188
|
ignoreProcessEnv: true
|
|
4189
|
+
}).parsed;
|
|
4190
|
+
Object.keys(parsed).forEach((key) => {
|
|
4191
|
+
parsed[key] = expandParsed[key];
|
|
4202
4192
|
});
|
|
4203
4193
|
// only keys that start with prefix are exposed to client
|
|
4204
4194
|
for (const [key, value] of Object.entries(parsed)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -61,20 +61,20 @@
|
|
|
61
61
|
"esbuild": "^0.15.9",
|
|
62
62
|
"postcss": "^8.4.18",
|
|
63
63
|
"resolve": "^1.22.1",
|
|
64
|
-
"rollup": "
|
|
64
|
+
"rollup": "~3.3.0"
|
|
65
65
|
},
|
|
66
66
|
"optionalDependencies": {
|
|
67
67
|
"fsevents": "~2.3.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@ampproject/remapping": "^2.2.0",
|
|
71
|
-
"@babel/parser": "^7.20.
|
|
72
|
-
"@babel/types": "^7.20.
|
|
71
|
+
"@babel/parser": "^7.20.2",
|
|
72
|
+
"@babel/types": "^7.20.2",
|
|
73
73
|
"@jridgewell/trace-mapping": "^0.3.17",
|
|
74
74
|
"@rollup/plugin-alias": "^4.0.2",
|
|
75
75
|
"@rollup/plugin-commonjs": "^23.0.2",
|
|
76
76
|
"@rollup/plugin-dynamic-import-vars": "^2.0.1",
|
|
77
|
-
"@rollup/plugin-json": "^
|
|
77
|
+
"@rollup/plugin-json": "^5.0.1",
|
|
78
78
|
"@rollup/plugin-node-resolve": "14.1.0",
|
|
79
79
|
"@rollup/plugin-typescript": "^8.5.0",
|
|
80
80
|
"@rollup/pluginutils": "^4.2.1",
|
|
@@ -117,10 +117,10 @@
|
|
|
117
117
|
"strip-ansi": "^7.0.1",
|
|
118
118
|
"strip-literal": "^0.4.2",
|
|
119
119
|
"tsconfck": "^2.0.1",
|
|
120
|
-
"tslib": "^2.4.
|
|
120
|
+
"tslib": "^2.4.1",
|
|
121
121
|
"types": "link:./types",
|
|
122
122
|
"ufo": "^0.8.6",
|
|
123
|
-
"ws": "^8.
|
|
123
|
+
"ws": "^8.11.0"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
126
|
"@types/node": ">= 14",
|