vite 6.2.1 → 6.2.2
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.
@@ -5066,7 +5066,7 @@ function isReference(node, parent) {
|
|
5066
5066
|
return false;
|
5067
5067
|
}
|
5068
5068
|
|
5069
|
-
var version$2 = "28.0.
|
5069
|
+
var version$2 = "28.0.3";
|
5070
5070
|
var peerDependencies = {
|
5071
5071
|
rollup: "^2.68.0||^3.0.0||^4.0.0"
|
5072
5072
|
};
|
@@ -5431,7 +5431,7 @@ export function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
5431
5431
|
}
|
5432
5432
|
|
5433
5433
|
export function getAugmentedNamespace(n) {
|
5434
|
-
if (n
|
5434
|
+
if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
|
5435
5435
|
var f = n.default;
|
5436
5436
|
if (typeof f == "function") {
|
5437
5437
|
var a = function a () {
|
@@ -30731,7 +30731,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
|
|
30731
30731
|
if (!pos.source) {
|
30732
30732
|
return input;
|
30733
30733
|
}
|
30734
|
-
const trimmedVarName = varName
|
30734
|
+
const trimmedVarName = varName?.trim();
|
30735
30735
|
const sourceFile = path$d.resolve(path$d.dirname(id), pos.source);
|
30736
30736
|
const source = `${sourceFile}:${pos.line}:${pos.column + 1}`;
|
30737
30737
|
if (!trimmedVarName || trimmedVarName === "eval") {
|
@@ -42908,12 +42908,6 @@ function isBareRelative(url) {
|
|
42908
42908
|
}
|
42909
42909
|
const processNodeUrl = (url, useSrcSetReplacer, config, htmlPath, originalUrl, server, isClassicScriptLink) => {
|
42910
42910
|
const replacer = (url2) => {
|
42911
|
-
if (server) {
|
42912
|
-
const mod = server.environments.client.moduleGraph.urlToModuleMap.get(url2);
|
42913
|
-
if (mod && mod.lastHMRTimestamp > 0) {
|
42914
|
-
url2 = injectQuery(url2, `t=${mod.lastHMRTimestamp}`);
|
42915
|
-
}
|
42916
|
-
}
|
42917
42911
|
if (url2[0] === "/" && url2[1] !== "/" || // #3230 if some request url (localhost:3000/a/b) return to fallback html, the relative assets
|
42918
42912
|
// path will add `/a/` prefix, it will caused 404.
|
42919
42913
|
//
|
@@ -42925,8 +42919,8 @@ const processNodeUrl = (url, useSrcSetReplacer, config, htmlPath, originalUrl, s
|
|
42925
42919
|
(url2[0] === "." || isBareRelative(url2)) && originalUrl && originalUrl !== "/" && htmlPath === "/index.html") {
|
42926
42920
|
url2 = path$d.posix.join(config.base, url2);
|
42927
42921
|
}
|
42928
|
-
|
42929
|
-
|
42922
|
+
let preTransformUrl;
|
42923
|
+
if (!isClassicScriptLink && shouldPreTransform(url2, config)) {
|
42930
42924
|
if (url2[0] === "/" && url2[1] !== "/") {
|
42931
42925
|
preTransformUrl = url2;
|
42932
42926
|
} else if (url2[0] === "." || isBareRelative(url2)) {
|
@@ -42936,14 +42930,22 @@ const processNodeUrl = (url, useSrcSetReplacer, config, htmlPath, originalUrl, s
|
|
42936
42930
|
url2
|
42937
42931
|
);
|
42938
42932
|
}
|
42939
|
-
|
42940
|
-
|
42941
|
-
|
42942
|
-
|
42943
|
-
|
42944
|
-
|
42945
|
-
|
42933
|
+
}
|
42934
|
+
if (server) {
|
42935
|
+
const mod = server.environments.client.moduleGraph.urlToModuleMap.get(
|
42936
|
+
preTransformUrl || url2
|
42937
|
+
);
|
42938
|
+
if (mod && mod.lastHMRTimestamp > 0) {
|
42939
|
+
url2 = injectQuery(url2, `t=${mod.lastHMRTimestamp}`);
|
42940
|
+
}
|
42941
|
+
}
|
42942
|
+
if (server && preTransformUrl) {
|
42943
|
+
try {
|
42944
|
+
preTransformUrl = decodeURI(preTransformUrl);
|
42945
|
+
} catch {
|
42946
|
+
return url2;
|
42946
42947
|
}
|
42948
|
+
preTransformRequest(server, preTransformUrl, config.decodedBase);
|
42947
42949
|
}
|
42948
42950
|
return url2;
|
42949
42951
|
};
|
@@ -45381,6 +45383,17 @@ const WORKER_FILE_ID = "worker_file";
|
|
45381
45383
|
const workerCache = /* @__PURE__ */ new WeakMap();
|
45382
45384
|
function saveEmitWorkerAsset(config, asset) {
|
45383
45385
|
const workerMap = workerCache.get(config.mainConfig || config);
|
45386
|
+
const duplicateAsset = workerMap.assets.get(asset.fileName);
|
45387
|
+
if (duplicateAsset) {
|
45388
|
+
if (!isSameContent(duplicateAsset.source, asset.source)) {
|
45389
|
+
config.logger.warn(
|
45390
|
+
`
|
45391
|
+
` + colors$1.yellow(
|
45392
|
+
`The emitted file ${JSON.stringify(asset.fileName)} overwrites a previously emitted file of the same name.`
|
45393
|
+
)
|
45394
|
+
);
|
45395
|
+
}
|
45396
|
+
}
|
45384
45397
|
workerMap.assets.set(asset.fileName, asset);
|
45385
45398
|
}
|
45386
45399
|
async function bundleWorkerEntry(config, id) {
|
@@ -48082,15 +48095,10 @@ class PluginContainer {
|
|
48082
48095
|
// For backward compatibility, buildStart and watchChange are called only for the client environment
|
48083
48096
|
// buildStart is called per environment for a plugin with the perEnvironmentStartEndDuring dev flag
|
48084
48097
|
async buildStart(_options) {
|
48085
|
-
this.environments.client.pluginContainer.buildStart(
|
48086
|
-
_options
|
48087
|
-
);
|
48098
|
+
return this.environments.client.pluginContainer.buildStart(_options);
|
48088
48099
|
}
|
48089
48100
|
async watchChange(id, change) {
|
48090
|
-
this.environments.client.pluginContainer.watchChange(
|
48091
|
-
id,
|
48092
|
-
change
|
48093
|
-
);
|
48101
|
+
return this.environments.client.pluginContainer.watchChange(id, change);
|
48094
48102
|
}
|
48095
48103
|
async resolveId(rawId, importer, options) {
|
48096
48104
|
return this._getPluginContainer(options).resolveId(rawId, importer, options);
|
@@ -48687,12 +48695,17 @@ function cssPostPlugin(config) {
|
|
48687
48695
|
const injectCode = `var ${style} = document.createElement('style');${style}.textContent = ${cssString};document.head.appendChild(${style});`;
|
48688
48696
|
let injectionPoint;
|
48689
48697
|
const wrapIdx = code.indexOf("System.register");
|
48698
|
+
const singleQuoteUseStrict = `'use strict';`;
|
48699
|
+
const doubleQuoteUseStrict = `"use strict";`;
|
48690
48700
|
if (wrapIdx >= 0) {
|
48691
48701
|
const executeFnStart = code.indexOf("execute:", wrapIdx);
|
48692
48702
|
injectionPoint = code.indexOf("{", executeFnStart) + 1;
|
48703
|
+
} else if (code.includes(singleQuoteUseStrict)) {
|
48704
|
+
injectionPoint = code.indexOf(singleQuoteUseStrict) + singleQuoteUseStrict.length;
|
48705
|
+
} else if (code.includes(doubleQuoteUseStrict)) {
|
48706
|
+
injectionPoint = code.indexOf(doubleQuoteUseStrict) + doubleQuoteUseStrict.length;
|
48693
48707
|
} else {
|
48694
|
-
|
48695
|
-
injectionPoint = code.indexOf(insertMark) + insertMark.length;
|
48708
|
+
throw new Error("Injection point for inlined CSS not found");
|
48696
48709
|
}
|
48697
48710
|
s ||= new MagicString(code);
|
48698
48711
|
s.appendRight(injectionPoint, injectCode);
|
@@ -49217,8 +49230,8 @@ function createCachedImport(imp) {
|
|
49217
49230
|
return cached;
|
49218
49231
|
};
|
49219
49232
|
}
|
49220
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
49221
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
49233
|
+
const importPostcssImport = createCachedImport(() => import('./dep-dLifoI9c.js').then(function (n) { return n.i; }));
|
49234
|
+
const importPostcssModules = createCachedImport(() => import('./dep-BL6Xg-kE.js').then(function (n) { return n.i; }));
|
49222
49235
|
const importPostcss = createCachedImport(() => import('postcss'));
|
49223
49236
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
49224
49237
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -53450,7 +53463,7 @@ async function preview(inlineConfig = {}) {
|
|
53450
53463
|
`The directory "${clientOutDir}" does not exist. Did you build your project?`
|
53451
53464
|
);
|
53452
53465
|
}
|
53453
|
-
const httpsOptions = await resolveHttpsConfig(config.
|
53466
|
+
const httpsOptions = await resolveHttpsConfig(config.preview.https);
|
53454
53467
|
const app = connect$1();
|
53455
53468
|
const httpServer = await resolveHttpServer(config.preview, app, httpsOptions);
|
53456
53469
|
setClientErrorHandler(httpServer, config.logger);
|
@@ -54183,7 +54196,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
54183
54196
|
inlineConfig,
|
54184
54197
|
root: resolvedRoot,
|
54185
54198
|
base,
|
54186
|
-
decodedBase:
|
54199
|
+
decodedBase: decodeBase(base),
|
54187
54200
|
rawBase: resolvedBase,
|
54188
54201
|
publicDir: resolvedPublicDir,
|
54189
54202
|
cacheDir,
|
@@ -54382,6 +54395,15 @@ function resolveBaseUrl(base = configDefaults.base, isBuild, logger) {
|
|
54382
54395
|
}
|
54383
54396
|
return base;
|
54384
54397
|
}
|
54398
|
+
function decodeBase(base) {
|
54399
|
+
try {
|
54400
|
+
return decodeURI(base);
|
54401
|
+
} catch {
|
54402
|
+
throw new Error(
|
54403
|
+
'The value passed to "base" option was malformed. It should be a valid URL.'
|
54404
|
+
);
|
54405
|
+
}
|
54406
|
+
}
|
54385
54407
|
function sortUserPlugins(plugins) {
|
54386
54408
|
const prePlugins = [];
|
54387
54409
|
const postPlugins = [];
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-B0fRCRkQ.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-B0fRCRkQ.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-B0fRCRkQ.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-B0fRCRkQ.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-B0fRCRkQ.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-B0fRCRkQ.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-B0fRCRkQ.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-B0fRCRkQ.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';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "6.2.
|
3
|
+
"version": "6.2.2",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -85,7 +85,7 @@
|
|
85
85
|
"@jridgewell/trace-mapping": "^0.3.25",
|
86
86
|
"@polka/compression": "^1.0.0-next.25",
|
87
87
|
"@rollup/plugin-alias": "^5.1.1",
|
88
|
-
"@rollup/plugin-commonjs": "^28.0.
|
88
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
89
89
|
"@rollup/plugin-dynamic-import-vars": "2.1.4",
|
90
90
|
"@rollup/plugin-json": "^6.1.0",
|
91
91
|
"@rollup/plugin-node-resolve": "16.0.0",
|
@@ -109,11 +109,11 @@
|
|
109
109
|
"etag": "^1.8.1",
|
110
110
|
"http-proxy": "^1.18.1",
|
111
111
|
"launch-editor-middleware": "^2.10.0",
|
112
|
-
"lightningcss": "^1.29.
|
112
|
+
"lightningcss": "^1.29.2",
|
113
113
|
"magic-string": "^0.30.17",
|
114
114
|
"mlly": "^1.7.4",
|
115
115
|
"mrmime": "^2.0.1",
|
116
|
-
"nanoid": "^5.1.
|
116
|
+
"nanoid": "^5.1.3",
|
117
117
|
"open": "^10.1.0",
|
118
118
|
"parse5": "^7.2.1",
|
119
119
|
"pathe": "^2.0.3",
|