vite 6.0.12 → 6.0.13
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.
@@ -9749,10 +9749,10 @@ function removeImportQuery(url) {
|
|
9749
9749
|
function removeDirectQuery(url) {
|
9750
9750
|
return url.replace(directRequestRE$1, "$1").replace(trailingSeparatorRE, "");
|
9751
9751
|
}
|
9752
|
-
const urlRE = /(\?|&)url(?:&|$)/;
|
9753
|
-
const rawRE = /(\?|&)raw(?:&|$)/;
|
9752
|
+
const urlRE$1 = /(\?|&)url(?:&|$)/;
|
9753
|
+
const rawRE$1 = /(\?|&)raw(?:&|$)/;
|
9754
9754
|
function removeUrlQuery(url) {
|
9755
|
-
return url.replace(urlRE, "$1").replace(trailingSeparatorRE, "");
|
9755
|
+
return url.replace(urlRE$1, "$1").replace(trailingSeparatorRE, "");
|
9756
9756
|
}
|
9757
9757
|
function injectQuery(url, queryToInject) {
|
9758
9758
|
const { file, postfix } = splitFileAndPostfix(url);
|
@@ -13379,7 +13379,7 @@ function checkPublicFile(url, config) {
|
|
13379
13379
|
const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g;
|
13380
13380
|
const jsSourceMapRE = /\.[cm]?js\.map$/;
|
13381
13381
|
const noInlineRE = /[?&]no-inline\b/;
|
13382
|
-
const inlineRE$
|
13382
|
+
const inlineRE$3 = /[?&]inline\b/;
|
13383
13383
|
const svgExtRE = /\.svg(?:$|\?)/;
|
13384
13384
|
const assetCache = /* @__PURE__ */ new WeakMap();
|
13385
13385
|
const cssEntriesMap = /* @__PURE__ */ new WeakMap();
|
@@ -13446,7 +13446,7 @@ function assetPlugin(config) {
|
|
13446
13446
|
cssEntriesMap.set(this.environment, /* @__PURE__ */ new Set());
|
13447
13447
|
},
|
13448
13448
|
resolveId(id) {
|
13449
|
-
if (!config.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) {
|
13449
|
+
if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) {
|
13450
13450
|
return;
|
13451
13451
|
}
|
13452
13452
|
const publicFile = checkPublicFile(id, config);
|
@@ -13458,14 +13458,14 @@ function assetPlugin(config) {
|
|
13458
13458
|
if (id[0] === "\0") {
|
13459
13459
|
return;
|
13460
13460
|
}
|
13461
|
-
if (rawRE.test(id)) {
|
13461
|
+
if (rawRE$1.test(id)) {
|
13462
13462
|
const file = checkPublicFile(id, config) || cleanUrl(id);
|
13463
13463
|
this.addWatchFile(file);
|
13464
13464
|
return `export default ${JSON.stringify(
|
13465
13465
|
await fsp.readFile(file, "utf-8")
|
13466
13466
|
)}`;
|
13467
13467
|
}
|
13468
|
-
if (!urlRE.test(id) && !config.assetsInclude(cleanUrl(id))) {
|
13468
|
+
if (!urlRE$1.test(id) && !config.assetsInclude(cleanUrl(id))) {
|
13469
13469
|
return;
|
13470
13470
|
}
|
13471
13471
|
id = removeUrlQuery(id);
|
@@ -13523,7 +13523,7 @@ async function fileToUrl$1(pluginContext, id) {
|
|
13523
13523
|
async function fileToDevUrl(environment, id, skipBase = false) {
|
13524
13524
|
const config = environment.getTopLevelConfig();
|
13525
13525
|
const publicFile = checkPublicFile(id, config);
|
13526
|
-
if (inlineRE$
|
13526
|
+
if (inlineRE$3.test(id)) {
|
13527
13527
|
const file = publicFile || cleanUrl(id);
|
13528
13528
|
const content = await fsp.readFile(file);
|
13529
13529
|
return assetToDataURL(environment, file, content);
|
@@ -13580,7 +13580,7 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
|
|
13580
13580
|
if (!skipPublicCheck) {
|
13581
13581
|
const publicFile = checkPublicFile(id, topLevelConfig);
|
13582
13582
|
if (publicFile) {
|
13583
|
-
if (inlineRE$
|
13583
|
+
if (inlineRE$3.test(id)) {
|
13584
13584
|
id = publicFile;
|
13585
13585
|
} else {
|
13586
13586
|
return publicFileToBuiltUrl(id, topLevelConfig);
|
@@ -13629,7 +13629,7 @@ async function urlToBuiltUrl(pluginContext, url, importer, forceInline) {
|
|
13629
13629
|
}
|
13630
13630
|
function shouldInline(environment, file, id, content, buildPluginContext, forceInline) {
|
13631
13631
|
if (noInlineRE.test(id)) return false;
|
13632
|
-
if (inlineRE$
|
13632
|
+
if (inlineRE$3.test(id)) return true;
|
13633
13633
|
if (buildPluginContext) {
|
13634
13634
|
if (environment.config.build.lib) return true;
|
13635
13635
|
if (buildPluginContext.getModuleInfo(id)?.isEntry) return false;
|
@@ -40894,7 +40894,7 @@ function servePublicMiddleware(server, publicFiles) {
|
|
40894
40894
|
};
|
40895
40895
|
return function viteServePublicMiddleware(req, res, next) {
|
40896
40896
|
if (publicFiles && !publicFiles.has(toFilePath(req.url)) || isImportRequest(req.url) || isInternalRequest(req.url) || // for `/public-file.js?url` to be transformed
|
40897
|
-
urlRE.test(req.url)) {
|
40897
|
+
urlRE$1.test(req.url)) {
|
40898
40898
|
return next();
|
40899
40899
|
}
|
40900
40900
|
serve(req, res, next);
|
@@ -42538,6 +42538,9 @@ function incrementIndent(indent = "") {
|
|
42538
42538
|
const debugCache = createDebugger("vite:cache");
|
42539
42539
|
const knownIgnoreList = /* @__PURE__ */ new Set(["/", "/favicon.ico"]);
|
42540
42540
|
const trailingQuerySeparatorsRE = /[?&]+$/;
|
42541
|
+
const urlRE = /[?&]url\b/;
|
42542
|
+
const rawRE = /[?&]raw\b/;
|
42543
|
+
const inlineRE$2 = /[?&]inline\b/;
|
42541
42544
|
function cachedTransformMiddleware(server) {
|
42542
42545
|
return function viteCachedTransformMiddleware(req, res, next) {
|
42543
42546
|
const environment = server.environments.client;
|
@@ -42627,7 +42630,7 @@ function transformMiddleware(server) {
|
|
42627
42630
|
trailingQuerySeparatorsRE,
|
42628
42631
|
""
|
42629
42632
|
);
|
42630
|
-
if ((rawRE.test(urlWithoutTrailingQuerySeparators) || urlRE.test(urlWithoutTrailingQuerySeparators)) && !ensureServingAccess(
|
42633
|
+
if ((rawRE.test(urlWithoutTrailingQuerySeparators) || urlRE.test(urlWithoutTrailingQuerySeparators) || inlineRE$2.test(urlWithoutTrailingQuerySeparators)) && !ensureServingAccess(
|
42631
42634
|
urlWithoutTrailingQuerySeparators,
|
42632
42635
|
server,
|
42633
42636
|
res,
|
@@ -45494,7 +45497,7 @@ function webWorkerPlugin(config) {
|
|
45494
45497
|
url = injectQuery(url, `${WORKER_FILE_ID}&type=${workerType}`);
|
45495
45498
|
urlCode = JSON.stringify(url);
|
45496
45499
|
}
|
45497
|
-
if (urlRE.test(id)) {
|
45500
|
+
if (urlRE$1.test(id)) {
|
45498
45501
|
return {
|
45499
45502
|
code: `export default ${urlCode}`,
|
45500
45503
|
map: { mappings: "" }
|
@@ -45936,7 +45939,7 @@ function importAnalysisPlugin(config) {
|
|
45936
45939
|
if (specifier === clientPublicPath) {
|
45937
45940
|
return;
|
45938
45941
|
}
|
45939
|
-
if (specifier[0] === "/" && !(config.assetsInclude(cleanUrl(specifier)) || urlRE.test(specifier)) && checkPublicFile(specifier, config)) {
|
45942
|
+
if (specifier[0] === "/" && !(config.assetsInclude(cleanUrl(specifier)) || urlRE$1.test(specifier)) && checkPublicFile(specifier, config)) {
|
45940
45943
|
throw new Error(
|
45941
45944
|
`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(
|
45942
45945
|
specifier,
|
@@ -46879,7 +46882,7 @@ function parseDynamicImportPattern(strings) {
|
|
46879
46882
|
let globParams = null;
|
46880
46883
|
if (search) {
|
46881
46884
|
search = "?" + search;
|
46882
|
-
if (workerOrSharedWorkerRE.test(search) || urlRE.test(search) || rawRE.test(search)) {
|
46885
|
+
if (workerOrSharedWorkerRE.test(search) || urlRE$1.test(search) || rawRE$1.test(search)) {
|
46883
46886
|
globParams = {
|
46884
46887
|
query: search,
|
46885
46888
|
import: "*"
|
@@ -47987,7 +47990,7 @@ function cssPlugin(config) {
|
|
47987
47990
|
},
|
47988
47991
|
async load(id) {
|
47989
47992
|
if (!isCSSRequest(id)) return;
|
47990
|
-
if (urlRE.test(id)) {
|
47993
|
+
if (urlRE$1.test(id)) {
|
47991
47994
|
if (isModuleCSSRequest(id)) {
|
47992
47995
|
throw new Error(
|
47993
47996
|
`?url is not supported with CSS modules. (tried to import ${JSON.stringify(
|
@@ -48889,8 +48892,8 @@ function createCachedImport(imp) {
|
|
48889
48892
|
return cached;
|
48890
48893
|
};
|
48891
48894
|
}
|
48892
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
48893
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
48895
|
+
const importPostcssImport = createCachedImport(() => import('./dep-DhnKGRps.js').then(function (n) { return n.i; }));
|
48896
|
+
const importPostcssModules = createCachedImport(() => import('./dep-FOubBIyr.js').then(function (n) { return n.i; }));
|
48894
48897
|
const importPostcss = createCachedImport(() => import('postcss'));
|
48895
48898
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
48896
48899
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { O as commonjsGlobal, N as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { O as commonjsGlobal, N as getDefaultExportFromCjs } from './dep-CikthXDd.js';
|
2
2
|
import require$$0$2 from 'fs';
|
3
3
|
import require$$0 from 'postcss';
|
4
4
|
import require$$0$1 from 'path';
|
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 { M as colors, G as createLogger, r as resolveConfig } from './chunks/dep-
|
5
|
+
import { M as colors, G as createLogger, r as resolveConfig } from './chunks/dep-CikthXDd.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -741,7 +741,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
741
741
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
742
742
|
).action(async (root, options) => {
|
743
743
|
filterDuplicateOptions(options);
|
744
|
-
const { createServer } = await import('./chunks/dep-
|
744
|
+
const { createServer } = await import('./chunks/dep-CikthXDd.js').then(function (n) { return n.Q; });
|
745
745
|
try {
|
746
746
|
const server = await createServer({
|
747
747
|
root,
|
@@ -834,7 +834,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
834
834
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
835
835
|
async (root, options) => {
|
836
836
|
filterDuplicateOptions(options);
|
837
|
-
const { createBuilder } = await import('./chunks/dep-
|
837
|
+
const { createBuilder } = await import('./chunks/dep-CikthXDd.js').then(function (n) { return n.R; });
|
838
838
|
const buildOptions = cleanGlobalCLIOptions(
|
839
839
|
cleanBuilderCLIOptions(options)
|
840
840
|
);
|
@@ -869,7 +869,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
869
869
|
).action(
|
870
870
|
async (root, options) => {
|
871
871
|
filterDuplicateOptions(options);
|
872
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
872
|
+
const { optimizeDeps } = await import('./chunks/dep-CikthXDd.js').then(function (n) { return n.P; });
|
873
873
|
try {
|
874
874
|
const config = await resolveConfig(
|
875
875
|
{
|
@@ -895,7 +895,7 @@ ${e.stack}`),
|
|
895
895
|
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(
|
896
896
|
async (root, options) => {
|
897
897
|
filterDuplicateOptions(options);
|
898
|
-
const { preview } = await import('./chunks/dep-
|
898
|
+
const { preview } = await import('./chunks/dep-CikthXDd.js').then(function (n) { return n.S; });
|
899
899
|
try {
|
900
900
|
const server = await preview({
|
901
901
|
root,
|
package/dist/node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
2
|
-
import { i as isInNodeModules, a as arraify } from './chunks/dep-
|
3
|
-
export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, C as createFilter, h as createIdResolver, G as createLogger, n as createRunnableDevEnvironment, c as createServer, w as createServerHotChannel, v as createServerModuleRunner, d as defineConfig, u as fetchModule, j as formatPostcssSourceMap, J as isFileLoadingAllowed, I as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, K as loadEnv, A as mergeAlias, z as mergeConfig, x as moduleRunnerTransform, y as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, L as resolveEnvPrefix, E as rollupVersion, H as searchForWorkspaceRoot, F as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
2
|
+
import { i as isInNodeModules, a as arraify } from './chunks/dep-CikthXDd.js';
|
3
|
+
export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, C as createFilter, h as createIdResolver, G as createLogger, n as createRunnableDevEnvironment, c as createServer, w as createServerHotChannel, v as createServerModuleRunner, d as defineConfig, u as fetchModule, j as formatPostcssSourceMap, J as isFileLoadingAllowed, I as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, K as loadEnv, A as mergeAlias, z as mergeConfig, x as moduleRunnerTransform, y as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, L as resolveEnvPrefix, E as rollupVersion, H as searchForWorkspaceRoot, F as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-CikthXDd.js';
|
4
4
|
export { 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';
|