Update package dependencies and remove unused files from node_modules
This commit is contained in:
124
node_modules/vite/dist/node/cli.js
generated
vendored
124
node_modules/vite/dist/node/cli.js
generated
vendored
@@ -2,22 +2,23 @@ import path from 'node:path';
|
||||
import fs__default from 'node:fs';
|
||||
import { performance } from 'node:perf_hooks';
|
||||
import { EventEmitter } from 'events';
|
||||
import { O as colors, I as createLogger, r as resolveConfig } from './chunks/dep-DBxKXgDP.js';
|
||||
import { B as colors, v as createLogger, r as resolveConfig } from './chunks/dep-C6uTJdX2.js';
|
||||
import { VERSION } from './constants.js';
|
||||
import 'node:fs/promises';
|
||||
import 'node:url';
|
||||
import 'node:util';
|
||||
import 'node:module';
|
||||
import 'node:crypto';
|
||||
import 'picomatch';
|
||||
import 'esbuild';
|
||||
import 'tty';
|
||||
import 'path';
|
||||
import 'esbuild';
|
||||
import 'fs';
|
||||
import 'fdir';
|
||||
import 'node:events';
|
||||
import 'node:stream';
|
||||
import 'node:string_decoder';
|
||||
import 'node:child_process';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'tty';
|
||||
import 'util';
|
||||
import 'net';
|
||||
import 'url';
|
||||
@@ -26,26 +27,22 @@ import 'stream';
|
||||
import 'os';
|
||||
import 'child_process';
|
||||
import 'node:os';
|
||||
import 'node:net';
|
||||
import 'node:dns';
|
||||
import 'vite/module-runner';
|
||||
import 'rollup/parseAst';
|
||||
import 'node:buffer';
|
||||
import 'module';
|
||||
import 'node:readline';
|
||||
import 'node:process';
|
||||
import 'node:events';
|
||||
import 'tinyglobby';
|
||||
import 'crypto';
|
||||
import 'module';
|
||||
import 'node:assert';
|
||||
import 'node:v8';
|
||||
import 'node:worker_threads';
|
||||
import 'https';
|
||||
import 'tls';
|
||||
import 'node:buffer';
|
||||
import 'rollup/parseAst';
|
||||
import 'querystring';
|
||||
import 'node:readline';
|
||||
import 'zlib';
|
||||
import 'buffer';
|
||||
import 'https';
|
||||
import 'tls';
|
||||
import 'node:net';
|
||||
import 'assert';
|
||||
import 'node:querystring';
|
||||
import 'node:zlib';
|
||||
|
||||
function toArr(any) {
|
||||
@@ -693,7 +690,7 @@ const filterDuplicateOptions = (options) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
function cleanGlobalCLIOptions(options) {
|
||||
function cleanOptions(options) {
|
||||
const ret = { ...options };
|
||||
delete ret["--"];
|
||||
delete ret.c;
|
||||
@@ -702,27 +699,16 @@ function cleanGlobalCLIOptions(options) {
|
||||
delete ret.l;
|
||||
delete ret.logLevel;
|
||||
delete ret.clearScreen;
|
||||
delete ret.configLoader;
|
||||
delete ret.d;
|
||||
delete ret.debug;
|
||||
delete ret.f;
|
||||
delete ret.filter;
|
||||
delete ret.m;
|
||||
delete ret.mode;
|
||||
delete ret.w;
|
||||
if ("sourcemap" in ret) {
|
||||
const sourcemap = ret.sourcemap;
|
||||
ret.sourcemap = sourcemap === "true" ? true : sourcemap === "false" ? false : ret.sourcemap;
|
||||
}
|
||||
if ("watch" in ret) {
|
||||
const watch = ret.watch;
|
||||
ret.watch = watch ? {} : void 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function cleanBuilderCLIOptions(options) {
|
||||
const ret = { ...options };
|
||||
delete ret.app;
|
||||
return ret;
|
||||
}
|
||||
const convertHost = (v) => {
|
||||
@@ -739,34 +725,29 @@ const convertBase = (v) => {
|
||||
};
|
||||
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`);
|
||||
}).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).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`);
|
||||
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) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { createServer } = await import('./chunks/dep-DBxKXgDP.js').then(function (n) { return n.S; });
|
||||
const { createServer } = await import('./chunks/dep-C6uTJdX2.js').then(function (n) { return n.F; });
|
||||
try {
|
||||
const server = await createServer({
|
||||
root,
|
||||
base: options.base,
|
||||
mode: options.mode,
|
||||
configFile: options.config,
|
||||
configLoader: options.configLoader,
|
||||
logLevel: options.logLevel,
|
||||
clearScreen: options.clearScreen,
|
||||
server: cleanGlobalCLIOptions(options),
|
||||
forceOptimizeDeps: options.force
|
||||
optimizeDeps: { force: options.force },
|
||||
server: cleanOptions(options)
|
||||
});
|
||||
if (!server.httpServer) {
|
||||
throw new Error("HTTP server not available");
|
||||
}
|
||||
await server.listen();
|
||||
const info = server.config.logger.info;
|
||||
const modeString = options.mode && options.mode !== "development" ? ` ${colors.bgGreen(` ${colors.bold(options.mode)} `)}` : "";
|
||||
const viteStartTime = global.__vite_start_time ?? false;
|
||||
const startupDurationString = viteStartTime ? colors.dim(
|
||||
`ready in ${colors.reset(
|
||||
@@ -778,7 +759,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
||||
`
|
||||
${colors.green(
|
||||
`${colors.bold("VITE")} v${VERSION}`
|
||||
)}${modeString} ${startupDurationString}
|
||||
)} ${startupDurationString}
|
||||
`,
|
||||
{
|
||||
clear: !hasExistingLogs
|
||||
@@ -840,56 +821,44 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
||||
).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) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { createBuilder } = await import('./chunks/dep-DBxKXgDP.js').then(function (n) { return n.T; });
|
||||
const buildOptions = cleanGlobalCLIOptions(
|
||||
cleanBuilderCLIOptions(options)
|
||||
);
|
||||
try {
|
||||
const inlineConfig = {
|
||||
root,
|
||||
base: options.base,
|
||||
mode: options.mode,
|
||||
configFile: options.config,
|
||||
configLoader: options.configLoader,
|
||||
logLevel: options.logLevel,
|
||||
clearScreen: options.clearScreen,
|
||||
build: buildOptions,
|
||||
...options.app ? { builder: {} } : {}
|
||||
};
|
||||
const builder = await createBuilder(inlineConfig, null);
|
||||
await builder.buildApp();
|
||||
} catch (e) {
|
||||
createLogger(options.logLevel).error(
|
||||
colors.red(`error during build:
|
||||
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).action(async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { build } = await import('./chunks/dep-C6uTJdX2.js').then(function (n) { return n.G; });
|
||||
const buildOptions = cleanOptions(options);
|
||||
try {
|
||||
await build({
|
||||
root,
|
||||
base: options.base,
|
||||
mode: options.mode,
|
||||
configFile: options.config,
|
||||
logLevel: options.logLevel,
|
||||
clearScreen: options.clearScreen,
|
||||
build: buildOptions
|
||||
});
|
||||
} catch (e) {
|
||||
createLogger(options.logLevel).error(
|
||||
colors.red(`error during build:
|
||||
${e.stack}`),
|
||||
{ error: e }
|
||||
);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
||||
}
|
||||
{ error: e }
|
||||
);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
||||
}
|
||||
);
|
||||
cli.command(
|
||||
"optimize [root]",
|
||||
"pre-bundle dependencies (deprecated, the pre-bundle process runs automatically and does not need to be called)"
|
||||
).option(
|
||||
});
|
||||
cli.command("optimize [root]", "pre-bundle dependencies").option(
|
||||
"--force",
|
||||
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
||||
).action(
|
||||
async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { optimizeDeps } = await import('./chunks/dep-DBxKXgDP.js').then(function (n) { return n.R; });
|
||||
const { optimizeDeps } = await import('./chunks/dep-C6uTJdX2.js').then(function (n) { return n.E; });
|
||||
try {
|
||||
const config = await resolveConfig(
|
||||
{
|
||||
root,
|
||||
base: options.base,
|
||||
configFile: options.config,
|
||||
configLoader: options.configLoader,
|
||||
logLevel: options.logLevel,
|
||||
mode: options.mode
|
||||
},
|
||||
@@ -909,13 +878,12 @@ ${e.stack}`),
|
||||
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) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { preview } = await import('./chunks/dep-DBxKXgDP.js').then(function (n) { return n.U; });
|
||||
const { preview } = await import('./chunks/dep-C6uTJdX2.js').then(function (n) { return n.H; });
|
||||
try {
|
||||
const server = await preview({
|
||||
root,
|
||||
base: options.base,
|
||||
configFile: options.config,
|
||||
configLoader: options.configLoader,
|
||||
logLevel: options.logLevel,
|
||||
mode: options.mode,
|
||||
build: {
|
||||
|
Reference in New Issue
Block a user