vite 6.1.2 → 6.1.3
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.
@@ -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);
|
@@ -13444,7 +13444,7 @@ function checkPublicFile(url, config) {
|
|
13444
13444
|
const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g;
|
13445
13445
|
const jsSourceMapRE = /\.[cm]?js\.map$/;
|
13446
13446
|
const noInlineRE = /[?&]no-inline\b/;
|
13447
|
-
const inlineRE$
|
13447
|
+
const inlineRE$3 = /[?&]inline\b/;
|
13448
13448
|
const svgExtRE = /\.svg(?:$|\?)/;
|
13449
13449
|
const assetCache = /* @__PURE__ */ new WeakMap();
|
13450
13450
|
const cssEntriesMap = /* @__PURE__ */ new WeakMap();
|
@@ -13511,7 +13511,7 @@ function assetPlugin(config) {
|
|
13511
13511
|
cssEntriesMap.set(this.environment, /* @__PURE__ */ new Set());
|
13512
13512
|
},
|
13513
13513
|
resolveId(id) {
|
13514
|
-
if (!config.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) {
|
13514
|
+
if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) {
|
13515
13515
|
return;
|
13516
13516
|
}
|
13517
13517
|
const publicFile = checkPublicFile(id, config);
|
@@ -13523,14 +13523,14 @@ function assetPlugin(config) {
|
|
13523
13523
|
if (id[0] === "\0") {
|
13524
13524
|
return;
|
13525
13525
|
}
|
13526
|
-
if (rawRE.test(id)) {
|
13526
|
+
if (rawRE$1.test(id)) {
|
13527
13527
|
const file = checkPublicFile(id, config) || cleanUrl(id);
|
13528
13528
|
this.addWatchFile(file);
|
13529
13529
|
return `export default ${JSON.stringify(
|
13530
13530
|
await fsp.readFile(file, "utf-8")
|
13531
13531
|
)}`;
|
13532
13532
|
}
|
13533
|
-
if (!urlRE.test(id) && !config.assetsInclude(cleanUrl(id))) {
|
13533
|
+
if (!urlRE$1.test(id) && !config.assetsInclude(cleanUrl(id))) {
|
13534
13534
|
return;
|
13535
13535
|
}
|
13536
13536
|
id = removeUrlQuery(id);
|
@@ -13588,7 +13588,7 @@ async function fileToUrl$1(pluginContext, id) {
|
|
13588
13588
|
async function fileToDevUrl(environment, id, skipBase = false) {
|
13589
13589
|
const config = environment.getTopLevelConfig();
|
13590
13590
|
const publicFile = checkPublicFile(id, config);
|
13591
|
-
if (inlineRE$
|
13591
|
+
if (inlineRE$3.test(id)) {
|
13592
13592
|
const file = publicFile || cleanUrl(id);
|
13593
13593
|
const content = await fsp.readFile(file);
|
13594
13594
|
return assetToDataURL(environment, file, content);
|
@@ -13645,7 +13645,7 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
|
|
13645
13645
|
if (!skipPublicCheck) {
|
13646
13646
|
const publicFile = checkPublicFile(id, topLevelConfig);
|
13647
13647
|
if (publicFile) {
|
13648
|
-
if (inlineRE$
|
13648
|
+
if (inlineRE$3.test(id)) {
|
13649
13649
|
id = publicFile;
|
13650
13650
|
} else {
|
13651
13651
|
return publicFileToBuiltUrl(id, topLevelConfig);
|
@@ -13694,7 +13694,7 @@ async function urlToBuiltUrl(pluginContext, url, importer, forceInline) {
|
|
13694
13694
|
}
|
13695
13695
|
function shouldInline(environment, file, id, content, buildPluginContext, forceInline) {
|
13696
13696
|
if (noInlineRE.test(id)) return false;
|
13697
|
-
if (inlineRE$
|
13697
|
+
if (inlineRE$3.test(id)) return true;
|
13698
13698
|
if (buildPluginContext) {
|
13699
13699
|
if (environment.config.build.lib) return true;
|
13700
13700
|
if (buildPluginContext.getModuleInfo(id)?.isEntry) return false;
|
@@ -41862,7 +41862,7 @@ function servePublicMiddleware(server, publicFiles) {
|
|
41862
41862
|
};
|
41863
41863
|
return function viteServePublicMiddleware(req, res, next) {
|
41864
41864
|
if (publicFiles && !publicFiles.has(toFilePath(req.url)) || isImportRequest(req.url) || isInternalRequest(req.url) || // for `/public-file.js?url` to be transformed
|
41865
|
-
urlRE.test(req.url)) {
|
41865
|
+
urlRE$1.test(req.url)) {
|
41866
41866
|
return next();
|
41867
41867
|
}
|
41868
41868
|
serve(req, res, next);
|
@@ -43525,6 +43525,9 @@ function decodeURIIfPossible(input) {
|
|
43525
43525
|
const debugCache = createDebugger("vite:cache");
|
43526
43526
|
const knownIgnoreList = /* @__PURE__ */ new Set(["/", "/favicon.ico"]);
|
43527
43527
|
const trailingQuerySeparatorsRE = /[?&]+$/;
|
43528
|
+
const urlRE = /[?&]url\b/;
|
43529
|
+
const rawRE = /[?&]raw\b/;
|
43530
|
+
const inlineRE$2 = /[?&]inline\b/;
|
43528
43531
|
function cachedTransformMiddleware(server) {
|
43529
43532
|
return function viteCachedTransformMiddleware(req, res, next) {
|
43530
43533
|
const environment = server.environments.client;
|
@@ -43614,7 +43617,7 @@ function transformMiddleware(server) {
|
|
43614
43617
|
trailingQuerySeparatorsRE,
|
43615
43618
|
""
|
43616
43619
|
);
|
43617
|
-
if ((rawRE.test(urlWithoutTrailingQuerySeparators) || urlRE.test(urlWithoutTrailingQuerySeparators)) && !ensureServingAccess(
|
43620
|
+
if ((rawRE.test(urlWithoutTrailingQuerySeparators) || urlRE.test(urlWithoutTrailingQuerySeparators) || inlineRE$2.test(urlWithoutTrailingQuerySeparators)) && !ensureServingAccess(
|
43618
43621
|
urlWithoutTrailingQuerySeparators,
|
43619
43622
|
server,
|
43620
43623
|
res,
|
@@ -46486,7 +46489,7 @@ function webWorkerPlugin(config) {
|
|
46486
46489
|
url = injectQuery(url, `${WORKER_FILE_ID}&type=${workerType}`);
|
46487
46490
|
urlCode = JSON.stringify(url);
|
46488
46491
|
}
|
46489
|
-
if (urlRE.test(id)) {
|
46492
|
+
if (urlRE$1.test(id)) {
|
46490
46493
|
return {
|
46491
46494
|
code: `export default ${urlCode}`,
|
46492
46495
|
map: { mappings: "" }
|
@@ -46928,7 +46931,7 @@ function importAnalysisPlugin(config) {
|
|
46928
46931
|
if (specifier === clientPublicPath) {
|
46929
46932
|
return;
|
46930
46933
|
}
|
46931
|
-
if (specifier[0] === "/" && !(config.assetsInclude(cleanUrl(specifier)) || urlRE.test(specifier)) && checkPublicFile(specifier, config)) {
|
46934
|
+
if (specifier[0] === "/" && !(config.assetsInclude(cleanUrl(specifier)) || urlRE$1.test(specifier)) && checkPublicFile(specifier, config)) {
|
46932
46935
|
throw new Error(
|
46933
46936
|
`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(
|
46934
46937
|
specifier,
|
@@ -47949,7 +47952,7 @@ function parseDynamicImportPattern(strings) {
|
|
47949
47952
|
let globParams = null;
|
47950
47953
|
if (search) {
|
47951
47954
|
search = "?" + search;
|
47952
|
-
if (workerOrSharedWorkerRE.test(search) || urlRE.test(search) || rawRE.test(search)) {
|
47955
|
+
if (workerOrSharedWorkerRE.test(search) || urlRE$1.test(search) || rawRE$1.test(search)) {
|
47953
47956
|
globParams = {
|
47954
47957
|
query: search,
|
47955
47958
|
import: "*"
|
@@ -49087,7 +49090,7 @@ function cssPlugin(config) {
|
|
49087
49090
|
},
|
49088
49091
|
async load(id) {
|
49089
49092
|
if (!isCSSRequest(id)) return;
|
49090
|
-
if (urlRE.test(id)) {
|
49093
|
+
if (urlRE$1.test(id)) {
|
49091
49094
|
if (isModuleCSSRequest(id)) {
|
49092
49095
|
throw new Error(
|
49093
49096
|
`?url is not supported with CSS modules. (tried to import ${JSON.stringify(
|
@@ -49998,8 +50001,8 @@ function createCachedImport(imp) {
|
|
49998
50001
|
return cached;
|
49999
50002
|
};
|
50000
50003
|
}
|
50001
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
50002
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
50004
|
+
const importPostcssImport = createCachedImport(() => import('./dep-BSgDXZup.js').then(function (n) { return n.i; }));
|
50005
|
+
const importPostcssModules = createCachedImport(() => import('./dep-DxUYic98.js').then(function (n) { return n.i; }));
|
50003
50006
|
const importPostcss = createCachedImport(() => import('postcss'));
|
50004
50007
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
50005
50008
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-DsKUDpAA.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 { 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-DsKUDpAA.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-DsKUDpAA.js').then(function (n) { return n.S; });
|
749
749
|
try {
|
750
750
|
const server = await createServer({
|
751
751
|
root,
|
@@ -839,7 +839,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
839
839
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
840
840
|
async (root, options) => {
|
841
841
|
filterDuplicateOptions(options);
|
842
|
-
const { createBuilder } = await import('./chunks/dep-
|
842
|
+
const { createBuilder } = await import('./chunks/dep-DsKUDpAA.js').then(function (n) { return n.T; });
|
843
843
|
const buildOptions = cleanGlobalCLIOptions(
|
844
844
|
cleanBuilderCLIOptions(options)
|
845
845
|
);
|
@@ -878,7 +878,7 @@ cli.command(
|
|
878
878
|
).action(
|
879
879
|
async (root, options) => {
|
880
880
|
filterDuplicateOptions(options);
|
881
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
881
|
+
const { optimizeDeps } = await import('./chunks/dep-DsKUDpAA.js').then(function (n) { return n.R; });
|
882
882
|
try {
|
883
883
|
const config = await resolveConfig(
|
884
884
|
{
|
@@ -905,7 +905,7 @@ ${e.stack}`),
|
|
905
905
|
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(
|
906
906
|
async (root, options) => {
|
907
907
|
filterDuplicateOptions(options);
|
908
|
-
const { preview } = await import('./chunks/dep-
|
908
|
+
const { preview } = await import('./chunks/dep-DsKUDpAA.js').then(function (n) { return n.U; });
|
909
909
|
try {
|
910
910
|
const server = await preview({
|
911
911
|
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, 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 { i as isInNodeModules, a as arraify } from './chunks/dep-DsKUDpAA.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-DsKUDpAA.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';
|