vite 5.4.3 → 5.4.4
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 { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-BEhTnQAI.js';
|
2
2
|
import require$$0__default from 'fs';
|
3
3
|
import require$$0 from 'postcss';
|
4
4
|
import require$$0$1 from 'path';
|
@@ -36953,8 +36953,8 @@ function createCachedImport(imp) {
|
|
36953
36953
|
return cached;
|
36954
36954
|
};
|
36955
36955
|
}
|
36956
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
36957
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
36956
|
+
const importPostcssImport = createCachedImport(() => import('./dep-CapdzPRN.js').then(function (n) { return n.i; }));
|
36957
|
+
const importPostcssModules = createCachedImport(() => import('./dep-B8D18a-R.js').then(function (n) { return n.i; }));
|
36958
36958
|
const importPostcss = createCachedImport(() => import('postcss'));
|
36959
36959
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
36960
36960
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -49552,7 +49552,8 @@ const commentRE = /<!--.*?-->/gs;
|
|
49552
49552
|
const srcRE = /\bsrc\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
|
49553
49553
|
const typeRE = /\btype\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
|
49554
49554
|
const langRE = /\blang\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
|
49555
|
-
const
|
49555
|
+
const svelteScriptModuleRE = /\bcontext\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
|
49556
|
+
const svelteModuleRE = /\smodule\b/i;
|
49556
49557
|
function esbuildScanPlugin(config, container, depImports, missing, entries) {
|
49557
49558
|
const seen = /* @__PURE__ */ new Map();
|
49558
49559
|
const resolve = async (id, importer, options) => {
|
@@ -49683,12 +49684,21 @@ function esbuildScanPlugin(config, container, depImports, missing, entries) {
|
|
49683
49684
|
};
|
49684
49685
|
}
|
49685
49686
|
const virtualModulePath = JSON.stringify(virtualModulePrefix + key);
|
49686
|
-
|
49687
|
-
|
49688
|
-
|
49689
|
-
|
49687
|
+
let addedImport = false;
|
49688
|
+
if (p.endsWith(".svelte")) {
|
49689
|
+
let isModule = svelteModuleRE.test(openTag);
|
49690
|
+
if (!isModule) {
|
49691
|
+
const contextMatch = svelteScriptModuleRE.exec(openTag);
|
49692
|
+
const context = contextMatch && (contextMatch[1] || contextMatch[2] || contextMatch[3]);
|
49693
|
+
isModule = context === "module";
|
49694
|
+
}
|
49695
|
+
if (!isModule) {
|
49696
|
+
addedImport = true;
|
49697
|
+
js += `import ${virtualModulePath}
|
49690
49698
|
`;
|
49691
|
-
|
49699
|
+
}
|
49700
|
+
}
|
49701
|
+
if (!addedImport) {
|
49692
49702
|
js += `export * from ${virtualModulePath}
|
49693
49703
|
`;
|
49694
49704
|
}
|
@@ -61715,7 +61725,7 @@ function cachedTransformMiddleware(server) {
|
|
61715
61725
|
const ifNoneMatch = req.headers["if-none-match"];
|
61716
61726
|
if (ifNoneMatch) {
|
61717
61727
|
const moduleByEtag = server.moduleGraph.getModuleByEtag(ifNoneMatch);
|
61718
|
-
if (moduleByEtag?.transformResult?.etag === ifNoneMatch) {
|
61728
|
+
if (moduleByEtag?.transformResult?.etag === ifNoneMatch && moduleByEtag?.url === req.url) {
|
61719
61729
|
const maybeMixedEtag = isCSSRequest(req.url);
|
61720
61730
|
if (!maybeMixedEtag) {
|
61721
61731
|
debugCache?.(`[304] ${prettifyUrl(req.url, server.config.root)}`);
|
@@ -64469,7 +64479,7 @@ function preload(baseModule, deps, importerUrl) {
|
|
64469
64479
|
"meta[property=csp-nonce]"
|
64470
64480
|
);
|
64471
64481
|
const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
|
64472
|
-
promise = Promise.
|
64482
|
+
promise = Promise.allSettled(
|
64473
64483
|
deps.map((dep) => {
|
64474
64484
|
dep = assetsURL(dep, importerUrl);
|
64475
64485
|
if (dep in seen) return;
|
@@ -64510,15 +64520,19 @@ function preload(baseModule, deps, importerUrl) {
|
|
64510
64520
|
})
|
64511
64521
|
);
|
64512
64522
|
}
|
64513
|
-
return promise.then(() =>
|
64514
|
-
const
|
64515
|
-
|
64516
|
-
|
64517
|
-
|
64518
|
-
|
64519
|
-
|
64520
|
-
|
64523
|
+
return promise.then((res) => {
|
64524
|
+
for (const item of res || []) {
|
64525
|
+
if (item.status !== "rejected") continue;
|
64526
|
+
const e = new Event("vite:preloadError", {
|
64527
|
+
cancelable: true
|
64528
|
+
});
|
64529
|
+
e.payload = item.reason;
|
64530
|
+
window.dispatchEvent(e);
|
64531
|
+
if (!e.defaultPrevented) {
|
64532
|
+
throw item.reason;
|
64533
|
+
}
|
64521
64534
|
}
|
64535
|
+
return baseModule();
|
64522
64536
|
});
|
64523
64537
|
}
|
64524
64538
|
function buildImportAnalysisPlugin(config) {
|
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 { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-
|
5
|
+
import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-BEhTnQAI.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -730,7 +730,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
730
730
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
731
731
|
).action(async (root, options) => {
|
732
732
|
filterDuplicateOptions(options);
|
733
|
-
const { createServer } = await import('./chunks/dep-
|
733
|
+
const { createServer } = await import('./chunks/dep-BEhTnQAI.js').then(function (n) { return n.E; });
|
734
734
|
try {
|
735
735
|
const server = await createServer({
|
736
736
|
root,
|
@@ -822,7 +822,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
822
822
|
`[boolean] force empty outDir when it's outside of root`
|
823
823
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).action(async (root, options) => {
|
824
824
|
filterDuplicateOptions(options);
|
825
|
-
const { build } = await import('./chunks/dep-
|
825
|
+
const { build } = await import('./chunks/dep-BEhTnQAI.js').then(function (n) { return n.F; });
|
826
826
|
const buildOptions = cleanOptions(options);
|
827
827
|
try {
|
828
828
|
await build({
|
@@ -851,7 +851,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
851
851
|
).action(
|
852
852
|
async (root, options) => {
|
853
853
|
filterDuplicateOptions(options);
|
854
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
854
|
+
const { optimizeDeps } = await import('./chunks/dep-BEhTnQAI.js').then(function (n) { return n.D; });
|
855
855
|
try {
|
856
856
|
const config = await resolveConfig(
|
857
857
|
{
|
@@ -877,7 +877,7 @@ ${e.stack}`),
|
|
877
877
|
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(
|
878
878
|
async (root, options) => {
|
879
879
|
filterDuplicateOptions(options);
|
880
|
-
const { preview } = await import('./chunks/dep-
|
880
|
+
const { preview } = await import('./chunks/dep-BEhTnQAI.js').then(function (n) { return n.G; });
|
881
881
|
try {
|
882
882
|
const server = await preview({
|
883
883
|
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 build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
2
|
+
import { i as isInNodeModules, a as arraify } from './chunks/dep-BEhTnQAI.js';
|
3
|
+
export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-BEhTnQAI.js';
|
4
4
|
export { VERSION as version } from './constants.js';
|
5
5
|
export { version as esbuildVersion } from 'esbuild';
|
6
6
|
import { existsSync, readFileSync } from 'node:fs';
|