vite 6.2.3 → 6.2.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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-Pj_jxEzN.js';
|
2
2
|
import require$$0$2 from 'fs';
|
3
3
|
import require$$0 from 'postcss';
|
4
4
|
import require$$0$1 from 'path';
|
@@ -9769,10 +9769,10 @@ function removeImportQuery(url) {
|
|
9769
9769
|
function removeDirectQuery(url) {
|
9770
9770
|
return url.replace(directRequestRE$1, "$1").replace(trailingSeparatorRE, "");
|
9771
9771
|
}
|
9772
|
-
const urlRE = /(\?|&)url(?:&|$)/;
|
9773
|
-
const rawRE = /(\?|&)raw(?:&|$)/;
|
9772
|
+
const urlRE$1 = /(\?|&)url(?:&|$)/;
|
9773
|
+
const rawRE$1 = /(\?|&)raw(?:&|$)/;
|
9774
9774
|
function removeUrlQuery(url) {
|
9775
|
-
return url.replace(urlRE, "$1").replace(trailingSeparatorRE, "");
|
9775
|
+
return url.replace(urlRE$1, "$1").replace(trailingSeparatorRE, "");
|
9776
9776
|
}
|
9777
9777
|
function injectQuery(url, queryToInject) {
|
9778
9778
|
const { file, postfix } = splitFileAndPostfix(url);
|
@@ -13442,7 +13442,7 @@ function checkPublicFile(url, config) {
|
|
13442
13442
|
const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g;
|
13443
13443
|
const jsSourceMapRE = /\.[cm]?js\.map$/;
|
13444
13444
|
const noInlineRE = /[?&]no-inline\b/;
|
13445
|
-
const inlineRE$
|
13445
|
+
const inlineRE$3 = /[?&]inline\b/;
|
13446
13446
|
const svgExtRE = /\.svg(?:$|\?)/;
|
13447
13447
|
const assetCache = /* @__PURE__ */ new WeakMap();
|
13448
13448
|
const cssEntriesMap = /* @__PURE__ */ new WeakMap();
|
@@ -13509,7 +13509,7 @@ function assetPlugin(config) {
|
|
13509
13509
|
cssEntriesMap.set(this.environment, /* @__PURE__ */ new Set());
|
13510
13510
|
},
|
13511
13511
|
resolveId(id) {
|
13512
|
-
if (!config.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) {
|
13512
|
+
if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) {
|
13513
13513
|
return;
|
13514
13514
|
}
|
13515
13515
|
const publicFile = checkPublicFile(id, config);
|
@@ -13521,14 +13521,14 @@ function assetPlugin(config) {
|
|
13521
13521
|
if (id[0] === "\0") {
|
13522
13522
|
return;
|
13523
13523
|
}
|
13524
|
-
if (rawRE.test(id)) {
|
13524
|
+
if (rawRE$1.test(id)) {
|
13525
13525
|
const file = checkPublicFile(id, config) || cleanUrl(id);
|
13526
13526
|
this.addWatchFile(file);
|
13527
13527
|
return `export default ${JSON.stringify(
|
13528
13528
|
await fsp.readFile(file, "utf-8")
|
13529
13529
|
)}`;
|
13530
13530
|
}
|
13531
|
-
if (!urlRE.test(id) && !config.assetsInclude(cleanUrl(id))) {
|
13531
|
+
if (!urlRE$1.test(id) && !config.assetsInclude(cleanUrl(id))) {
|
13532
13532
|
return;
|
13533
13533
|
}
|
13534
13534
|
id = removeUrlQuery(id);
|
@@ -13586,13 +13586,14 @@ async function fileToUrl$1(pluginContext, id) {
|
|
13586
13586
|
async function fileToDevUrl(environment, id, skipBase = false) {
|
13587
13587
|
const config = environment.getTopLevelConfig();
|
13588
13588
|
const publicFile = checkPublicFile(id, config);
|
13589
|
-
if (inlineRE$
|
13589
|
+
if (inlineRE$3.test(id)) {
|
13590
13590
|
const file = publicFile || cleanUrl(id);
|
13591
13591
|
const content = await fsp.readFile(file);
|
13592
13592
|
return assetToDataURL(environment, file, content);
|
13593
13593
|
}
|
13594
|
-
|
13595
|
-
|
13594
|
+
const cleanedId = cleanUrl(id);
|
13595
|
+
if (svgExtRE.test(cleanedId)) {
|
13596
|
+
const file = publicFile || cleanedId;
|
13596
13597
|
const content = await fsp.readFile(file);
|
13597
13598
|
if (shouldInline(environment, file, id, content, void 0, void 0)) {
|
13598
13599
|
return assetToDataURL(environment, file, content);
|
@@ -13643,7 +13644,7 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
|
|
13643
13644
|
if (!skipPublicCheck) {
|
13644
13645
|
const publicFile = checkPublicFile(id, topLevelConfig);
|
13645
13646
|
if (publicFile) {
|
13646
|
-
if (inlineRE$
|
13647
|
+
if (inlineRE$3.test(id)) {
|
13647
13648
|
id = publicFile;
|
13648
13649
|
} else {
|
13649
13650
|
return publicFileToBuiltUrl(id, topLevelConfig);
|
@@ -13692,7 +13693,7 @@ async function urlToBuiltUrl(pluginContext, url, importer, forceInline) {
|
|
13692
13693
|
}
|
13693
13694
|
function shouldInline(environment, file, id, content, buildPluginContext, forceInline) {
|
13694
13695
|
if (noInlineRE.test(id)) return false;
|
13695
|
-
if (inlineRE$
|
13696
|
+
if (inlineRE$3.test(id)) return true;
|
13696
13697
|
if (buildPluginContext) {
|
13697
13698
|
if (environment.config.build.lib) return true;
|
13698
13699
|
if (buildPluginContext.getModuleInfo(id)?.isEntry) return false;
|
@@ -15478,7 +15479,7 @@ function jsonPlugin(options, isBuild) {
|
|
15478
15479
|
transform(json, id) {
|
15479
15480
|
if (!jsonExtRE.test(id)) return null;
|
15480
15481
|
if (SPECIAL_QUERY_RE.test(id)) return null;
|
15481
|
-
if (inlineRE$
|
15482
|
+
if (inlineRE$3.test(id) || noInlineRE.test(id)) {
|
15482
15483
|
this.warn(
|
15483
15484
|
`
|
15484
15485
|
Using ?inline or ?no-inline for JSON imports will have no effect.
|
@@ -41016,7 +41017,7 @@ function servePublicMiddleware(server, publicFiles) {
|
|
41016
41017
|
};
|
41017
41018
|
return function viteServePublicMiddleware(req, res, next) {
|
41018
41019
|
if (publicFiles && !publicFiles.has(toFilePath(req.url)) || isImportRequest(req.url) || isInternalRequest(req.url) || // for `/public-file.js?url` to be transformed
|
41019
|
-
urlRE.test(req.url)) {
|
41020
|
+
urlRE$1.test(req.url)) {
|
41020
41021
|
return next();
|
41021
41022
|
}
|
41022
41023
|
serve(req, res, next);
|
@@ -41149,6 +41150,7 @@ function renderRestrictedErrorHTML(msg) {
|
|
41149
41150
|
|
41150
41151
|
const ERR_LOAD_URL = "ERR_LOAD_URL";
|
41151
41152
|
const ERR_LOAD_PUBLIC_URL = "ERR_LOAD_PUBLIC_URL";
|
41153
|
+
const ERR_DENIED_ID = "ERR_DENIED_ID";
|
41152
41154
|
const debugLoad = createDebugger("vite:load");
|
41153
41155
|
const debugTransform = createDebugger("vite:transform");
|
41154
41156
|
const debugCache$1 = createDebugger("vite:cache");
|
@@ -41248,6 +41250,11 @@ async function loadAndTransform(environment, id, url, options, timestamp, mod, r
|
|
41248
41250
|
const { config, pluginContainer, logger } = environment;
|
41249
41251
|
const prettyUrl = debugLoad || debugTransform ? prettifyUrl(url, config.root) : "";
|
41250
41252
|
const moduleGraph = environment.moduleGraph;
|
41253
|
+
if (options.allowId && !options.allowId(id)) {
|
41254
|
+
const err = new Error(`Denied ID ${id}`);
|
41255
|
+
err.code = ERR_DENIED_ID;
|
41256
|
+
throw err;
|
41257
|
+
}
|
41251
41258
|
let code = null;
|
41252
41259
|
let map = null;
|
41253
41260
|
const loadStart = debugLoad ? performance$1.now() : 0;
|
@@ -42679,6 +42686,13 @@ function decodeURIIfPossible(input) {
|
|
42679
42686
|
const debugCache = createDebugger("vite:cache");
|
42680
42687
|
const knownIgnoreList = /* @__PURE__ */ new Set(["/", "/favicon.ico"]);
|
42681
42688
|
const trailingQuerySeparatorsRE = /[?&]+$/;
|
42689
|
+
const urlRE = /[?&]url\b/;
|
42690
|
+
const rawRE = /[?&]raw\b/;
|
42691
|
+
const inlineRE$2 = /[?&]inline\b/;
|
42692
|
+
const svgRE = /\.svg\b/;
|
42693
|
+
function deniedServingAccessForTransform(url, server, res, next) {
|
42694
|
+
return (rawRE.test(url) || urlRE.test(url) || inlineRE$2.test(url) || svgRE.test(url)) && !ensureServingAccess(url, server, res, next);
|
42695
|
+
}
|
42682
42696
|
function cachedTransformMiddleware(server) {
|
42683
42697
|
return function viteCachedTransformMiddleware(req, res, next) {
|
42684
42698
|
const environment = server.environments.client;
|
@@ -42768,7 +42782,7 @@ function transformMiddleware(server) {
|
|
42768
42782
|
trailingQuerySeparatorsRE,
|
42769
42783
|
""
|
42770
42784
|
);
|
42771
|
-
if ((
|
42785
|
+
if (deniedServingAccessForTransform(
|
42772
42786
|
urlWithoutTrailingQuerySeparators,
|
42773
42787
|
server,
|
42774
42788
|
res,
|
@@ -42791,7 +42805,10 @@ function transformMiddleware(server) {
|
|
42791
42805
|
}
|
42792
42806
|
}
|
42793
42807
|
const result = await transformRequest(environment, url, {
|
42794
|
-
html: req.headers.accept?.includes("text/html")
|
42808
|
+
html: req.headers.accept?.includes("text/html"),
|
42809
|
+
allowId(id) {
|
42810
|
+
return !deniedServingAccessForTransform(id, server, res, next);
|
42811
|
+
}
|
42795
42812
|
});
|
42796
42813
|
if (result) {
|
42797
42814
|
const depsOptimizer = environment.depsOptimizer;
|
@@ -42843,6 +42860,9 @@ function transformMiddleware(server) {
|
|
42843
42860
|
if (e?.code === ERR_LOAD_URL) {
|
42844
42861
|
return next();
|
42845
42862
|
}
|
42863
|
+
if (e?.code === ERR_DENIED_ID) {
|
42864
|
+
return;
|
42865
|
+
}
|
42846
42866
|
return next(e);
|
42847
42867
|
}
|
42848
42868
|
next();
|
@@ -45659,7 +45679,7 @@ function webWorkerPlugin(config) {
|
|
45659
45679
|
url = injectQuery(url, `${WORKER_FILE_ID}&type=${workerType}`);
|
45660
45680
|
urlCode = JSON.stringify(url);
|
45661
45681
|
}
|
45662
|
-
if (urlRE.test(id)) {
|
45682
|
+
if (urlRE$1.test(id)) {
|
45663
45683
|
return {
|
45664
45684
|
code: `export default ${urlCode}`,
|
45665
45685
|
map: { mappings: "" }
|
@@ -46103,7 +46123,7 @@ function importAnalysisPlugin(config) {
|
|
46103
46123
|
if (specifier === clientPublicPath) {
|
46104
46124
|
return;
|
46105
46125
|
}
|
46106
|
-
if (specifier[0] === "/" && !(config.assetsInclude(cleanUrl(specifier)) || urlRE.test(specifier)) && checkPublicFile(specifier, config)) {
|
46126
|
+
if (specifier[0] === "/" && !(config.assetsInclude(cleanUrl(specifier)) || urlRE$1.test(specifier)) && checkPublicFile(specifier, config)) {
|
46107
46127
|
throw new Error(
|
46108
46128
|
`Cannot import non-asset file ${specifier} which is inside /public. JS/CSS files inside /public are copied as-is on build and can only be referenced via <script src> or <link href> in html. If you want to get the URL of that file, use ${injectQuery(
|
46109
46129
|
specifier,
|
@@ -46563,6 +46583,7 @@ function escapeReplacement(value) {
|
|
46563
46583
|
}
|
46564
46584
|
|
46565
46585
|
const wasmHelperId = "\0vite/wasm-helper.js";
|
46586
|
+
const wasmInitRE = /(?<![?#].*)\.wasm\?init/;
|
46566
46587
|
const wasmHelper = async (opts = {}, url) => {
|
46567
46588
|
let result;
|
46568
46589
|
if (url.startsWith("data:")) {
|
@@ -46607,7 +46628,7 @@ const wasmHelperPlugin = () => {
|
|
46607
46628
|
if (id === wasmHelperId) {
|
46608
46629
|
return `export default ${wasmHelperCode}`;
|
46609
46630
|
}
|
46610
|
-
if (!
|
46631
|
+
if (!wasmInitRE.test(id)) {
|
46611
46632
|
return;
|
46612
46633
|
}
|
46613
46634
|
const url = await fileToUrl$1(this, id);
|
@@ -47136,7 +47157,7 @@ function parseDynamicImportPattern(strings) {
|
|
47136
47157
|
let globParams = null;
|
47137
47158
|
if (search) {
|
47138
47159
|
search = "?" + search;
|
47139
|
-
if (workerOrSharedWorkerRE.test(search) || urlRE.test(search) || rawRE.test(search)) {
|
47160
|
+
if (workerOrSharedWorkerRE.test(search) || urlRE$1.test(search) || rawRE$1.test(search)) {
|
47140
47161
|
globParams = {
|
47141
47162
|
query: search,
|
47142
47163
|
import: "*"
|
@@ -48266,7 +48287,7 @@ function cssPlugin(config) {
|
|
48266
48287
|
},
|
48267
48288
|
async load(id) {
|
48268
48289
|
if (!isCSSRequest(id)) return;
|
48269
|
-
if (urlRE.test(id)) {
|
48290
|
+
if (urlRE$1.test(id)) {
|
48270
48291
|
if (isModuleCSSRequest(id)) {
|
48271
48292
|
throw new Error(
|
48272
48293
|
`?url is not supported with CSS modules. (tried to import ${JSON.stringify(
|
@@ -49240,8 +49261,8 @@ function createCachedImport(imp) {
|
|
49240
49261
|
return cached;
|
49241
49262
|
};
|
49242
49263
|
}
|
49243
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
49244
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
49264
|
+
const importPostcssImport = createCachedImport(() => import('./dep-Cnk50_Y_.js').then(function (n) { return n.i; }));
|
49265
|
+
const importPostcssModules = createCachedImport(() => import('./dep-HVlf0cxI.js').then(function (n) { return n.i; }));
|
49245
49266
|
const importPostcss = createCachedImport(() => import('postcss'));
|
49246
49267
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
49247
49268
|
let alwaysFakeWorkerWorkerControllerCache;
|
package/dist/node/cli.js
CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
2
2
|
import fs__default from 'node:fs';
|
3
3
|
import { performance } from 'node:perf_hooks';
|
4
4
|
import { EventEmitter } from 'events';
|
5
|
-
import { O as colors, I as createLogger, r as resolveConfig } from './chunks/dep-
|
5
|
+
import { O as colors, I as createLogger, r as resolveConfig } from './chunks/dep-Pj_jxEzN.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -745,7 +745,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
745
745
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
746
746
|
).action(async (root, options) => {
|
747
747
|
filterDuplicateOptions(options);
|
748
|
-
const { createServer } = await import('./chunks/dep-
|
748
|
+
const { createServer } = await import('./chunks/dep-Pj_jxEzN.js').then(function (n) { return n.S; });
|
749
749
|
try {
|
750
750
|
const server = await createServer({
|
751
751
|
root,
|
@@ -840,7 +840,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
840
840
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
841
841
|
async (root, options) => {
|
842
842
|
filterDuplicateOptions(options);
|
843
|
-
const { createBuilder } = await import('./chunks/dep-
|
843
|
+
const { createBuilder } = await import('./chunks/dep-Pj_jxEzN.js').then(function (n) { return n.T; });
|
844
844
|
const buildOptions = cleanGlobalCLIOptions(
|
845
845
|
cleanBuilderCLIOptions(options)
|
846
846
|
);
|
@@ -879,7 +879,7 @@ cli.command(
|
|
879
879
|
).action(
|
880
880
|
async (root, options) => {
|
881
881
|
filterDuplicateOptions(options);
|
882
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
882
|
+
const { optimizeDeps } = await import('./chunks/dep-Pj_jxEzN.js').then(function (n) { return n.R; });
|
883
883
|
try {
|
884
884
|
const config = await resolveConfig(
|
885
885
|
{
|
@@ -906,7 +906,7 @@ ${e.stack}`),
|
|
906
906
|
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(
|
907
907
|
async (root, options) => {
|
908
908
|
filterDuplicateOptions(options);
|
909
|
-
const { preview } = await import('./chunks/dep-
|
909
|
+
const { preview } = await import('./chunks/dep-Pj_jxEzN.js').then(function (n) { return n.U; });
|
910
910
|
try {
|
911
911
|
const server = await preview({
|
912
912
|
root,
|
package/dist/node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
2
|
-
import { a as arraify, i as isInNodeModules } from './chunks/dep-
|
3
|
-
export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, F as createFilter, h as createIdResolver, I as createLogger, n as createRunnableDevEnvironment, c as createServer, y as createServerHotChannel, w as createServerModuleRunner, x as createServerModuleRunnerTransport, d as defineConfig, v as fetchModule, j as formatPostcssSourceMap, L as isFileLoadingAllowed, K as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, M as loadEnv, E as mergeAlias, C as mergeConfig, z as moduleRunnerTransform, A as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, N as resolveEnvPrefix, G as rollupVersion, u as runnerImport, J as searchForWorkspaceRoot, H as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
2
|
+
import { a as arraify, i as isInNodeModules } from './chunks/dep-Pj_jxEzN.js';
|
3
|
+
export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, F as createFilter, h as createIdResolver, I as createLogger, n as createRunnableDevEnvironment, c as createServer, y as createServerHotChannel, w as createServerModuleRunner, x as createServerModuleRunnerTransport, d as defineConfig, v as fetchModule, j as formatPostcssSourceMap, L as isFileLoadingAllowed, K as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, M as loadEnv, E as mergeAlias, C as mergeConfig, z as moduleRunnerTransform, A as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, N as resolveEnvPrefix, G as rollupVersion, u as runnerImport, J as searchForWorkspaceRoot, H as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-Pj_jxEzN.js';
|
4
4
|
export { defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, VERSION as version } from './constants.js';
|
5
5
|
export { version as esbuildVersion } from 'esbuild';
|
6
6
|
import 'node:fs';
|