vite 6.3.2 → 6.3.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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
@@ -10559,7 +10559,7 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
|
|
10559
10559
|
if (cached) {
|
10560
10560
|
return cached;
|
10561
10561
|
}
|
10562
|
-
|
10562
|
+
let { file, postfix } = splitFileAndPostfix(id);
|
10563
10563
|
const content = await fsp.readFile(file);
|
10564
10564
|
let url;
|
10565
10565
|
if (shouldInline(environment, file, id, content, pluginContext, forceInline)) {
|
@@ -10575,6 +10575,9 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
|
|
10575
10575
|
originalFileName,
|
10576
10576
|
source: content
|
10577
10577
|
});
|
10578
|
+
if (environment.config.command === "build" && noInlineRE.test(postfix)) {
|
10579
|
+
postfix = postfix.replace(noInlineRE, "").replace(/^&/, "?");
|
10580
|
+
}
|
10578
10581
|
url = `__VITE_ASSET__${referenceId}__${postfix ? `$_${postfix}__` : ``}`;
|
10579
10582
|
}
|
10580
10583
|
cache.set(id, url);
|
@@ -25653,14 +25656,40 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
|
|
25653
25656
|
}
|
25654
25657
|
const imports = [];
|
25655
25658
|
const exports = [];
|
25659
|
+
const reExportImportIdMap = /* @__PURE__ */ new Map();
|
25656
25660
|
for (const node of ast.body) {
|
25657
25661
|
if (node.type === "ImportDeclaration") {
|
25658
25662
|
imports.push(node);
|
25659
|
-
} else if (node.type === "
|
25663
|
+
} else if (node.type === "ExportDefaultDeclaration") {
|
25664
|
+
exports.push(node);
|
25665
|
+
} else if (node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration") {
|
25666
|
+
imports.push(node);
|
25660
25667
|
exports.push(node);
|
25661
25668
|
}
|
25662
25669
|
}
|
25663
25670
|
for (const node of imports) {
|
25671
|
+
if (node.type === "ExportNamedDeclaration") {
|
25672
|
+
if (node.source) {
|
25673
|
+
const importId2 = defineImport(
|
25674
|
+
hoistIndex,
|
25675
|
+
node,
|
25676
|
+
{
|
25677
|
+
importedNames: node.specifiers.map(
|
25678
|
+
(s2) => getIdentifierNameOrLiteralValue$1(s2.local)
|
25679
|
+
)
|
25680
|
+
}
|
25681
|
+
);
|
25682
|
+
reExportImportIdMap.set(node, importId2);
|
25683
|
+
}
|
25684
|
+
continue;
|
25685
|
+
}
|
25686
|
+
if (node.type === "ExportAllDeclaration") {
|
25687
|
+
if (node.source) {
|
25688
|
+
const importId2 = defineImport(hoistIndex, node);
|
25689
|
+
reExportImportIdMap.set(node, importId2);
|
25690
|
+
}
|
25691
|
+
continue;
|
25692
|
+
}
|
25664
25693
|
const importId = defineImport(hoistIndex, node, {
|
25665
25694
|
importedNames: node.specifiers.map((s2) => {
|
25666
25695
|
if (s2.type === "ImportSpecifier")
|
@@ -25703,17 +25732,8 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
|
|
25703
25732
|
}
|
25704
25733
|
s.remove(node.start, node.declaration.start);
|
25705
25734
|
} else {
|
25706
|
-
s.remove(node.start, node.end);
|
25707
25735
|
if (node.source) {
|
25708
|
-
const importId =
|
25709
|
-
node.start,
|
25710
|
-
node,
|
25711
|
-
{
|
25712
|
-
importedNames: node.specifiers.map(
|
25713
|
-
(s2) => getIdentifierNameOrLiteralValue$1(s2.local)
|
25714
|
-
)
|
25715
|
-
}
|
25716
|
-
);
|
25736
|
+
const importId = reExportImportIdMap.get(node);
|
25717
25737
|
for (const spec of node.specifiers) {
|
25718
25738
|
const exportedAs = getIdentifierNameOrLiteralValue$1(
|
25719
25739
|
spec.exported
|
@@ -25728,6 +25748,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
|
|
25728
25748
|
}
|
25729
25749
|
}
|
25730
25750
|
} else {
|
25751
|
+
s.remove(node.start, node.end);
|
25731
25752
|
for (const spec of node.specifiers) {
|
25732
25753
|
const local = spec.local.name;
|
25733
25754
|
const binding = idToImportMap.get(local);
|
@@ -25748,20 +25769,19 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
|
|
25748
25769
|
node.start + 15
|
25749
25770
|
/* 'export default '.length */
|
25750
25771
|
);
|
25751
|
-
|
25752
|
-
`
|
25753
|
-
Object.defineProperty(${ssrModuleExportsKey}, "default", { enumerable: true, configurable: true, value: ${name} });`
|
25754
|
-
);
|
25772
|
+
defineExport("default", name);
|
25755
25773
|
} else {
|
25774
|
+
const name = `__vite_ssr_export_default__`;
|
25756
25775
|
s.update(
|
25757
25776
|
node.start,
|
25758
25777
|
node.start + 14,
|
25759
|
-
|
25778
|
+
`const ${name} =`
|
25760
25779
|
);
|
25780
|
+
defineExport("default", name);
|
25761
25781
|
}
|
25762
25782
|
}
|
25763
25783
|
if (node.type === "ExportAllDeclaration") {
|
25764
|
-
const importId =
|
25784
|
+
const importId = reExportImportIdMap.get(node);
|
25765
25785
|
if (node.exported) {
|
25766
25786
|
const exportedAs = getIdentifierNameOrLiteralValue$1(
|
25767
25787
|
node.exported
|
@@ -37096,6 +37116,12 @@ function transformMiddleware(server) {
|
|
37096
37116
|
"\0"
|
37097
37117
|
);
|
37098
37118
|
} catch (e) {
|
37119
|
+
if (e instanceof URIError) {
|
37120
|
+
server.config.logger.warn(
|
37121
|
+
colors$1.yellow("Malformed URI sequence in request URL")
|
37122
|
+
);
|
37123
|
+
return next();
|
37124
|
+
}
|
37099
37125
|
return next(e);
|
37100
37126
|
}
|
37101
37127
|
const withoutQuery = cleanUrl(url);
|
@@ -43446,6 +43472,7 @@ function getEmptyChunkReplacer(pureCssChunkNames, outputFormat) {
|
|
43446
43472
|
}
|
43447
43473
|
);
|
43448
43474
|
}
|
43475
|
+
const fileURLWithWindowsDriveRE = /^file:\/\/\/[a-zA-Z]:\//;
|
43449
43476
|
function createCSSResolvers(config) {
|
43450
43477
|
let cssResolve;
|
43451
43478
|
let sassResolve;
|
@@ -43475,7 +43502,7 @@ function createCSSResolvers(config) {
|
|
43475
43502
|
args[1] = fileURLToPath$1(args[1], {
|
43476
43503
|
windows: (
|
43477
43504
|
// file:///foo cannot be converted to path with windows mode
|
43478
|
-
isWindows$3 && args[1]
|
43505
|
+
isWindows$3 && !fileURLWithWindowsDriveRE.test(args[1]) ? false : void 0
|
43479
43506
|
)
|
43480
43507
|
});
|
43481
43508
|
}
|
@@ -43837,8 +43864,8 @@ function createCachedImport(imp) {
|
|
43837
43864
|
return cached;
|
43838
43865
|
};
|
43839
43866
|
}
|
43840
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
43841
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
43867
|
+
const importPostcssImport = createCachedImport(() => import('./dep-DD7x-aKn.js').then(function (n) { return n.i; }));
|
43868
|
+
const importPostcssModules = createCachedImport(() => import('./dep-CixbwhWq.js').then(function (n) { return n.i; }));
|
43842
43869
|
const importPostcss = createCachedImport(() => import('postcss'));
|
43843
43870
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
43844
43871
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -45392,19 +45419,11 @@ function buildImportAnalysisPlugin(config) {
|
|
45392
45419
|
if (code.indexOf(isModernFlag) > -1) {
|
45393
45420
|
const re = new RegExp(isModernFlag, "g");
|
45394
45421
|
const isModern = String(format === "es");
|
45395
|
-
|
45396
|
-
|
45397
|
-
|
45398
|
-
|
45399
|
-
|
45400
|
-
}
|
45401
|
-
return {
|
45402
|
-
code: s.toString(),
|
45403
|
-
map: s.generateMap({ hires: "boundary" })
|
45404
|
-
};
|
45405
|
-
} else {
|
45406
|
-
return code.replace(re, isModern);
|
45407
|
-
}
|
45422
|
+
const isModernWithPadding = isModern + " ".repeat(isModernFlag.length - isModern.length);
|
45423
|
+
return {
|
45424
|
+
code: code.replace(re, isModernWithPadding),
|
45425
|
+
map: null
|
45426
|
+
};
|
45408
45427
|
}
|
45409
45428
|
return null;
|
45410
45429
|
},
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-BMIURPaQ.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-BMIURPaQ.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -748,7 +748,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
748
748
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
749
749
|
).action(async (root, options) => {
|
750
750
|
filterDuplicateOptions(options);
|
751
|
-
const { createServer } = await import('./chunks/dep-
|
751
|
+
const { createServer } = await import('./chunks/dep-BMIURPaQ.js').then(function (n) { return n.S; });
|
752
752
|
try {
|
753
753
|
const server = await createServer({
|
754
754
|
root,
|
@@ -843,7 +843,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
843
843
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
844
844
|
async (root, options) => {
|
845
845
|
filterDuplicateOptions(options);
|
846
|
-
const { createBuilder } = await import('./chunks/dep-
|
846
|
+
const { createBuilder } = await import('./chunks/dep-BMIURPaQ.js').then(function (n) { return n.T; });
|
847
847
|
const buildOptions = cleanGlobalCLIOptions(
|
848
848
|
cleanBuilderCLIOptions(options)
|
849
849
|
);
|
@@ -882,7 +882,7 @@ cli.command(
|
|
882
882
|
).action(
|
883
883
|
async (root, options) => {
|
884
884
|
filterDuplicateOptions(options);
|
885
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
885
|
+
const { optimizeDeps } = await import('./chunks/dep-BMIURPaQ.js').then(function (n) { return n.R; });
|
886
886
|
try {
|
887
887
|
const config = await resolveConfig(
|
888
888
|
{
|
@@ -909,7 +909,7 @@ ${e.stack}`),
|
|
909
909
|
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(
|
910
910
|
async (root, options) => {
|
911
911
|
filterDuplicateOptions(options);
|
912
|
-
const { preview } = await import('./chunks/dep-
|
912
|
+
const { preview } = await import('./chunks/dep-BMIURPaQ.js').then(function (n) { return n.U; });
|
913
913
|
try {
|
914
914
|
const server = await preview({
|
915
915
|
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, D as DevEnvironment } from './chunks/dep-
|
3
|
-
export { B as BuildEnvironment, 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, D as DevEnvironment } from './chunks/dep-BMIURPaQ.js';
|
3
|
+
export { B as BuildEnvironment, 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-BMIURPaQ.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.3.
|
3
|
+
"version": "6.3.3",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -73,11 +73,11 @@
|
|
73
73
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
74
74
|
"dependencies": {
|
75
75
|
"esbuild": "^0.25.0",
|
76
|
-
"fdir": "^6.4.
|
76
|
+
"fdir": "^6.4.4",
|
77
77
|
"picomatch": "^4.0.2",
|
78
78
|
"postcss": "^8.5.3",
|
79
79
|
"rollup": "^4.34.9",
|
80
|
-
"tinyglobby": "^0.2.
|
80
|
+
"tinyglobby": "^0.2.13"
|
81
81
|
},
|
82
82
|
"optionalDependencies": {
|
83
83
|
"fsevents": "~2.3.3"
|