vite 7.1.0-beta.1 → 7.1.0
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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/dist/node/chunks/{dep-D3dx-MVo.js → dep-Bh-1mzXX.js} +1 -1
- package/dist/node/chunks/{dep-L2kJu-gJ.js → dep-Bq0QZiuR.js} +1 -1
- package/dist/node/chunks/{dep-ll8ogJMK.js → dep-By9Vn5UD.js} +1 -1
- package/dist/node/chunks/{dep-B-hsmHjg.js → dep-CZAfWeT9.js} +29 -24
- package/dist/node/chunks/{dep-bSJfBHhb.js → dep-CxRDE86e.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/index.js +1 -1
- package/package.json +1 -1
@@ -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-CZAfWeT9.js";
|
3
3
|
import "./dep-BDCsDwBr.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 { preview, resolvePreviewOptions } from "./dep-
|
2
|
+
import { preview, resolvePreviewOptions } from "./dep-CZAfWeT9.js";
|
3
3
|
import "./dep-BDCsDwBr.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 { 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-CZAfWeT9.js";
|
3
3
|
import "./dep-BDCsDwBr.js";
|
4
4
|
|
5
5
|
export { createBuilder, resolveBuildPlugins };
|
@@ -2451,6 +2451,8 @@ function numberToPos(source, offset$1) {
|
|
2451
2451
|
function generateCodeFrame(source, start = 0, end) {
|
2452
2452
|
start = Math.max(posToNumber(source, start), 0);
|
2453
2453
|
end = Math.min(end !== void 0 ? posToNumber(source, end) : start, source.length);
|
2454
|
+
const lastPosLine = end !== void 0 ? numberToPos(source, end).line : numberToPos(source, start).line + range;
|
2455
|
+
const lineNumberWidth = Math.max(3, String(lastPosLine).length + 1);
|
2454
2456
|
const lines = source.split(splitRE);
|
2455
2457
|
let count = 0;
|
2456
2458
|
const res = [];
|
@@ -2460,16 +2462,16 @@ function generateCodeFrame(source, start = 0, end) {
|
|
2460
2462
|
for (let j = i$1 - range; j <= i$1 + range || end > count; j++) {
|
2461
2463
|
if (j < 0 || j >= lines.length) continue;
|
2462
2464
|
const line = j + 1;
|
2463
|
-
res.push(`${line}${" ".repeat(
|
2465
|
+
res.push(`${line}${" ".repeat(lineNumberWidth - String(line).length)}| ${lines[j]}`);
|
2464
2466
|
const lineLength = lines[j].length;
|
2465
2467
|
if (j === i$1) {
|
2466
2468
|
const pad$2 = Math.max(start - (count - lineLength), 0);
|
2467
2469
|
const length = Math.max(1, end > count ? lineLength - pad$2 : end - start);
|
2468
|
-
res.push(
|
2470
|
+
res.push(`${" ".repeat(lineNumberWidth)}| ` + " ".repeat(pad$2) + "^".repeat(length));
|
2469
2471
|
} else if (j > i$1) {
|
2470
2472
|
if (end > count) {
|
2471
2473
|
const length = Math.max(Math.min(end - count, lineLength), 1);
|
2472
|
-
res.push(
|
2474
|
+
res.push(`${" ".repeat(lineNumberWidth)}| ` + "^".repeat(length));
|
2473
2475
|
}
|
2474
2476
|
count += lineLength + 1;
|
2475
2477
|
}
|
@@ -7936,7 +7938,7 @@ function manifestPlugin() {
|
|
7936
7938
|
return manifestChunk;
|
7937
7939
|
}
|
7938
7940
|
const entryCssReferenceIds = cssEntriesMap.get(this.environment);
|
7939
|
-
const entryCssAssetFileNames = new Set(
|
7941
|
+
const entryCssAssetFileNames = /* @__PURE__ */ new Set();
|
7940
7942
|
for (const id of entryCssReferenceIds) try {
|
7941
7943
|
const fileName = this.getFileName(id);
|
7942
7944
|
entryCssAssetFileNames.add(fileName);
|
@@ -26476,6 +26478,7 @@ async function loadAndTransform(environment, id, url$3, options$1, timestamp, mo
|
|
26476
26478
|
if (options$1.allowId && !options$1.allowId(id)) {
|
26477
26479
|
const err$2 = /* @__PURE__ */ new Error(`Denied ID ${id}`);
|
26478
26480
|
err$2.code = ERR_DENIED_ID;
|
26481
|
+
err$2.id = id;
|
26479
26482
|
throw err$2;
|
26480
26483
|
}
|
26481
26484
|
let code = null;
|
@@ -27521,18 +27524,8 @@ const urlRE$1 = /[?&]url\b/;
|
|
27521
27524
|
const rawRE$1 = /[?&]raw\b/;
|
27522
27525
|
const inlineRE$2 = /[?&]inline\b/;
|
27523
27526
|
const svgRE = /\.svg\b/;
|
27524
|
-
function
|
27525
|
-
if (rawRE$1.test(id) || urlRE$1.test(id) || inlineRE$2.test(id) || svgRE.test(id))
|
27526
|
-
const servingAccessResult = checkLoadingAccess(server.config, id);
|
27527
|
-
if (servingAccessResult === "denied") {
|
27528
|
-
respondWithAccessDenied(id, server, res);
|
27529
|
-
return true;
|
27530
|
-
}
|
27531
|
-
if (servingAccessResult === "fallback") {
|
27532
|
-
next();
|
27533
|
-
return true;
|
27534
|
-
}
|
27535
|
-
}
|
27527
|
+
function isServerAccessDeniedForTransform(config$2, id) {
|
27528
|
+
if (rawRE$1.test(id) || urlRE$1.test(id) || inlineRE$2.test(id) || svgRE.test(id)) return checkLoadingAccess(config$2, id) !== "allowed";
|
27536
27529
|
return false;
|
27537
27530
|
}
|
27538
27531
|
/**
|
@@ -27619,7 +27612,7 @@ function transformMiddleware(server) {
|
|
27619
27612
|
}
|
27620
27613
|
}
|
27621
27614
|
const result = await environment.transformRequest(url$3, { allowId(id) {
|
27622
|
-
return id.startsWith("\0") || !
|
27615
|
+
return id.startsWith("\0") || !isServerAccessDeniedForTransform(server.config, id);
|
27623
27616
|
} });
|
27624
27617
|
if (result) {
|
27625
27618
|
const depsOptimizer = environment.depsOptimizer;
|
@@ -27668,7 +27661,19 @@ function transformMiddleware(server) {
|
|
27668
27661
|
return;
|
27669
27662
|
}
|
27670
27663
|
if (e$1?.code === ERR_LOAD_URL) return next();
|
27671
|
-
if (e$1?.code === ERR_DENIED_ID)
|
27664
|
+
if (e$1?.code === ERR_DENIED_ID) {
|
27665
|
+
const id = e$1.id;
|
27666
|
+
const servingAccessResult = checkLoadingAccess(server.config, id);
|
27667
|
+
if (servingAccessResult === "denied") {
|
27668
|
+
respondWithAccessDenied(id, server, res);
|
27669
|
+
return true;
|
27670
|
+
}
|
27671
|
+
if (servingAccessResult === "fallback") {
|
27672
|
+
next();
|
27673
|
+
return true;
|
27674
|
+
}
|
27675
|
+
throw new Error(`Unexpected access result for id ${id}`);
|
27676
|
+
}
|
27672
27677
|
return next(e$1);
|
27673
27678
|
}
|
27674
27679
|
next();
|
@@ -31050,7 +31055,7 @@ function createFilterForTransform(idFilter, codeFilter, cwd) {
|
|
31050
31055
|
async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins) {
|
31051
31056
|
const isBuild = config$2.command === "build";
|
31052
31057
|
const isWorker = config$2.isWorker;
|
31053
|
-
const buildPlugins = isBuild ? await (await import("./dep-
|
31058
|
+
const buildPlugins = isBuild ? await (await import("./dep-By9Vn5UD.js")).resolveBuildPlugins(config$2) : {
|
31054
31059
|
pre: [],
|
31055
31060
|
post: []
|
31056
31061
|
};
|
@@ -32143,7 +32148,7 @@ function cssPostPlugin(config$2) {
|
|
32143
32148
|
}
|
32144
32149
|
},
|
32145
32150
|
async renderChunk(code, chunk, opts, meta) {
|
32146
|
-
let chunkCSS
|
32151
|
+
let chunkCSS;
|
32147
32152
|
const renderedModules = new Proxy({}, { get(_target, p$1) {
|
32148
32153
|
for (const name in meta.chunks) {
|
32149
32154
|
const modules = meta.chunks[name].modules;
|
@@ -32159,7 +32164,7 @@ function cssPostPlugin(config$2) {
|
|
32159
32164
|
const cssScopeTo = this.getModuleInfo(id)?.meta?.vite?.cssScopeTo;
|
32160
32165
|
if (cssScopeTo && !isCssScopeToRendered(cssScopeTo, renderedModules)) continue;
|
32161
32166
|
if (cssModuleRE.test(id)) isPureCssChunk = false;
|
32162
|
-
chunkCSS
|
32167
|
+
chunkCSS = (chunkCSS || "") + styles.get(id);
|
32163
32168
|
} else if (!isJsChunkEmpty) isPureCssChunk = false;
|
32164
32169
|
const publicAssetUrlMap = publicAssetUrlCache.get(config$2);
|
32165
32170
|
const resolveAssetUrlsInCss = (chunkCSS$1, cssAssetName) => {
|
@@ -32233,7 +32238,7 @@ function cssPostPlugin(config$2) {
|
|
32233
32238
|
s$2.update(start, end, replacementString);
|
32234
32239
|
}
|
32235
32240
|
}
|
32236
|
-
if (chunkCSS) {
|
32241
|
+
if (chunkCSS !== void 0) {
|
32237
32242
|
if (isPureCssChunk && (opts.format === "es" || opts.format === "cjs")) pureCssChunks.add(chunk);
|
32238
32243
|
if (this.environment.config.build.cssCodeSplit) {
|
32239
32244
|
if (opts.format === "es" || opts.format === "cjs") {
|
@@ -32795,7 +32800,7 @@ async function rewriteCssImageSet(css, replacer) {
|
|
32795
32800
|
});
|
32796
32801
|
}
|
32797
32802
|
function skipUrlReplacer(unquotedUrl) {
|
32798
|
-
return isExternalUrl(unquotedUrl) || isDataUrl(unquotedUrl) || unquotedUrl[0] === "#" || functionCallRE.test(unquotedUrl);
|
32803
|
+
return isExternalUrl(unquotedUrl) || isDataUrl(unquotedUrl) || unquotedUrl[0] === "#" || functionCallRE.test(unquotedUrl) || unquotedUrl.startsWith("__VITE_ASSET__") || unquotedUrl.startsWith("__VITE_PUBLIC_ASSET__");
|
32799
32804
|
}
|
32800
32805
|
async function doUrlReplace(rawUrl, matched, replacer, funcName = "url") {
|
32801
32806
|
let wrap$1 = "";
|
@@ -34214,7 +34219,7 @@ async function resolveBuildPlugins(config$2) {
|
|
34214
34219
|
return {
|
34215
34220
|
pre: [
|
34216
34221
|
completeSystemWrapPlugin(),
|
34217
|
-
prepareOutDirPlugin(),
|
34222
|
+
...!config$2.isWorker ? [prepareOutDirPlugin()] : [],
|
34218
34223
|
perEnvironmentPlugin("commonjs", (environment) => {
|
34219
34224
|
const { commonjsOptions } = environment.config.build;
|
34220
34225
|
const usePluginCommonjs = !Array.isArray(commonjsOptions.include) || commonjsOptions.include.length !== 0;
|
@@ -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-CZAfWeT9.js";
|
3
3
|
import "./dep-BDCsDwBr.js";
|
4
4
|
|
5
5
|
export { createServer };
|
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-CZAfWeT9.js";
|
4
4
|
import { VERSION } from "./chunks/dep-BDCsDwBr.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-CxRDE86e.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-By9Vn5UD.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-Bh-1mzXX.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-Bq0QZiuR.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-CZAfWeT9.js";
|
3
3
|
import { DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_EXTERNAL_CONDITIONS, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, VERSION, defaultAllowedOrigins } from "./chunks/dep-BDCsDwBr.js";
|
4
4
|
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
5
5
|
import { version as esbuildVersion } from "esbuild";
|