vite 6.1.0-beta.0 → 6.1.0-beta.1
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.
- package/dist/node/chunks/{dep-7ffYZsA7.js → dep-B0BOsDX1.js} +1 -1
- package/dist/node/chunks/{dep-BADA5W91.js → dep-BFhA-Un-.js} +1 -1
- package/dist/node/chunks/{dep-B8FkPgo5.js → dep-ChTE610F.js} +35 -19
- package/dist/node/cli.js +5 -5
- package/dist/node/constants.js +0 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +2 -2
- package/package.json +3 -3
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-ChTE610F.js';
|
2
2
|
import require$$0$2 from 'fs';
|
3
3
|
import require$$0 from 'postcss';
|
4
4
|
import require$$0$1 from 'path';
|
@@ -16097,7 +16097,8 @@ function resolvePlugin(resolveOptions) {
|
|
16097
16097
|
}
|
16098
16098
|
}
|
16099
16099
|
if (id.startsWith("file://")) {
|
16100
|
-
|
16100
|
+
const { file, postfix } = splitFileAndPostfix(id);
|
16101
|
+
id = fileURLToPath$1(file) + postfix;
|
16101
16102
|
}
|
16102
16103
|
if (isWindows$3 && id[0] === "/") {
|
16103
16104
|
const basedir = importer ? path$d.dirname(importer) : process.cwd();
|
@@ -16152,7 +16153,7 @@ function resolvePlugin(resolveOptions) {
|
|
16152
16153
|
)}"`;
|
16153
16154
|
}
|
16154
16155
|
message += `. Consider adding it to environments.${this.environment.name}.external if it is intended.`;
|
16155
|
-
this.
|
16156
|
+
this.warn(message);
|
16156
16157
|
}
|
16157
16158
|
return options.idOnly ? id : { id, external: true, moduleSideEffects: false };
|
16158
16159
|
} else if (currentEnvironmentOptions.consumer === "client" && isNodeLikeBuiltin(id)) {
|
@@ -17990,7 +17991,6 @@ class ScanEnvironment extends BaseEnvironment {
|
|
17990
17991
|
this,
|
17991
17992
|
this.plugins
|
17992
17993
|
);
|
17993
|
-
await this._pluginContainer.buildStart();
|
17994
17994
|
}
|
17995
17995
|
}
|
17996
17996
|
function devToScanEnvironment(environment) {
|
@@ -30807,9 +30807,9 @@ async function instantiateModule(url, runner, environment, fixStacktrace) {
|
|
30807
30807
|
ssrFixStacktrace(e, environment.moduleGraph);
|
30808
30808
|
}
|
30809
30809
|
environment.logger.error(
|
30810
|
-
|
30811
|
-
|
30812
|
-
|
30810
|
+
buildErrorMessage(e, [
|
30811
|
+
colors$1.red(`Error when evaluating SSR module ${url}: ${e.message}`)
|
30812
|
+
]),
|
30813
30813
|
{
|
30814
30814
|
timestamp: true,
|
30815
30815
|
clear: environment.config.clearScreen,
|
@@ -31588,7 +31588,7 @@ function isRefIdentifier(id, parent, parentStack) {
|
|
31588
31588
|
if (parent.type === "MemberExpression" && parent.property === id && !parent.computed) {
|
31589
31589
|
return false;
|
31590
31590
|
}
|
31591
|
-
if (parent.type === "ExportSpecifier") {
|
31591
|
+
if (parent.type === "ExportSpecifier" || parent.type === "ExportAllDeclaration") {
|
31592
31592
|
return false;
|
31593
31593
|
}
|
31594
31594
|
if (id.name === "arguments") {
|
@@ -37940,7 +37940,9 @@ function createWebSocketServer(server, config, httpsOptions) {
|
|
37940
37940
|
wsHttpServer.on("error", (e) => {
|
37941
37941
|
if (e.code === "EADDRINUSE") {
|
37942
37942
|
config.logger.error(
|
37943
|
-
colors$1.red(
|
37943
|
+
colors$1.red(
|
37944
|
+
`WebSocket server error: Port ${e.port} is already in use`
|
37945
|
+
),
|
37944
37946
|
{ error: e }
|
37945
37947
|
);
|
37946
37948
|
} else {
|
@@ -37984,7 +37986,7 @@ ${err.stack}`, {
|
|
37984
37986
|
wss.on("error", (e) => {
|
37985
37987
|
if (e.code === "EADDRINUSE") {
|
37986
37988
|
config.logger.error(
|
37987
|
-
colors$1.red(`WebSocket server error: Port is already in use`),
|
37989
|
+
colors$1.red(`WebSocket server error: Port ${e.port} is already in use`),
|
37988
37990
|
{ error: e }
|
37989
37991
|
);
|
37990
37992
|
} else {
|
@@ -40400,6 +40402,9 @@ ${err.stack}`,
|
|
40400
40402
|
if (typeof bypassResult === "string") {
|
40401
40403
|
debug$5?.(`bypass: ${req.url} -> ${bypassResult}`);
|
40402
40404
|
req.url = bypassResult;
|
40405
|
+
if (res.writableEnded) {
|
40406
|
+
return;
|
40407
|
+
}
|
40403
40408
|
return next();
|
40404
40409
|
}
|
40405
40410
|
if (bypassResult === false) {
|
@@ -49043,8 +49048,8 @@ function createCachedImport(imp) {
|
|
49043
49048
|
return cached;
|
49044
49049
|
};
|
49045
49050
|
}
|
49046
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
49047
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
49051
|
+
const importPostcssImport = createCachedImport(() => import('./dep-BFhA-Un-.js').then(function (n) { return n.i; }));
|
49052
|
+
const importPostcssModules = createCachedImport(() => import('./dep-B0BOsDX1.js').then(function (n) { return n.i; }));
|
49048
49053
|
const importPostcss = createCachedImport(() => import('postcss'));
|
49049
49054
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
49050
49055
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -49785,13 +49790,17 @@ async function rebaseUrls(environment, file, rootFile, alias, variablePrefix, re
|
|
49785
49790
|
};
|
49786
49791
|
}
|
49787
49792
|
const makeLessWorker = (environment, resolvers, alias, maxWorkers) => {
|
49788
|
-
const viteLessResolve = async (filename, dir, rootFile) => {
|
49793
|
+
const viteLessResolve = async (filename, dir, rootFile, mime) => {
|
49789
49794
|
const resolved = await resolvers.less(
|
49790
49795
|
environment,
|
49791
49796
|
filename,
|
49792
49797
|
path$d.join(dir, "*")
|
49793
49798
|
);
|
49794
49799
|
if (!resolved) return undefined;
|
49800
|
+
if (mime === "application/javascript") {
|
49801
|
+
const file = path$d.resolve(resolved);
|
49802
|
+
return { resolved: file };
|
49803
|
+
}
|
49795
49804
|
const result = await rebaseUrls(
|
49796
49805
|
environment,
|
49797
49806
|
resolved,
|
@@ -49825,7 +49834,12 @@ const makeLessWorker = (environment, resolvers, alias, maxWorkers) => {
|
|
49825
49834
|
return false;
|
49826
49835
|
}
|
49827
49836
|
async loadFile(filename, dir, opts, env) {
|
49828
|
-
const result = await viteLessResolve(
|
49837
|
+
const result = await viteLessResolve(
|
49838
|
+
filename,
|
49839
|
+
dir,
|
49840
|
+
this.rootFile,
|
49841
|
+
opts.mime
|
49842
|
+
);
|
49829
49843
|
if (result) {
|
49830
49844
|
return {
|
49831
49845
|
filename: path2.resolve(result.resolved),
|
@@ -53570,12 +53584,12 @@ const configDefaults = Object.freeze({
|
|
53570
53584
|
environments: {},
|
53571
53585
|
appType: "spa"
|
53572
53586
|
});
|
53573
|
-
function resolveDevEnvironmentOptions(dev, environmentName, consumer, skipSsrTransform) {
|
53587
|
+
function resolveDevEnvironmentOptions(dev, environmentName, consumer, skipSsrTransform, preTransformRequest) {
|
53574
53588
|
const resolved = mergeWithDefaults(
|
53575
53589
|
{
|
53576
53590
|
...configDefaults.dev,
|
53577
53591
|
sourcemapIgnoreList: isInNodeModules$1,
|
53578
|
-
preTransformRequests: consumer === "client",
|
53592
|
+
preTransformRequests: preTransformRequest ?? consumer === "client",
|
53579
53593
|
createEnvironment: environmentName === "client" ? defaultCreateClientDevEnvironment : defaultCreateDevEnvironment,
|
53580
53594
|
recoverable: consumer === "client",
|
53581
53595
|
moduleRunnerTransform: skipSsrTransform !== undefined && consumer === "server" ? skipSsrTransform : consumer === "server"
|
@@ -53587,7 +53601,7 @@ function resolveDevEnvironmentOptions(dev, environmentName, consumer, skipSsrTra
|
|
53587
53601
|
sourcemapIgnoreList: resolved.sourcemapIgnoreList === false ? () => false : resolved.sourcemapIgnoreList
|
53588
53602
|
};
|
53589
53603
|
}
|
53590
|
-
function resolveEnvironmentOptions(options, alias, preserveSymlinks, forceOptimizeDeps, logger, environmentName, skipSsrTransform, isSsrTargetWebworkerSet) {
|
53604
|
+
function resolveEnvironmentOptions(options, alias, preserveSymlinks, forceOptimizeDeps, logger, environmentName, skipSsrTransform, isSsrTargetWebworkerSet, preTransformRequests) {
|
53591
53605
|
const isClientEnvironment = environmentName === "client";
|
53592
53606
|
const consumer = options.consumer ?? (isClientEnvironment ? "client" : "server");
|
53593
53607
|
const isSsrTargetWebworkerEnvironment = isSsrTargetWebworkerSet && environmentName === "ssr";
|
@@ -53614,7 +53628,8 @@ function resolveEnvironmentOptions(options, alias, preserveSymlinks, forceOptimi
|
|
53614
53628
|
options.dev,
|
53615
53629
|
environmentName,
|
53616
53630
|
consumer,
|
53617
|
-
skipSsrTransform
|
53631
|
+
skipSsrTransform,
|
53632
|
+
preTransformRequests
|
53618
53633
|
),
|
53619
53634
|
build: resolveBuildEnvironmentOptions(
|
53620
53635
|
options.build ?? {},
|
@@ -53672,7 +53687,7 @@ function resolveEnvironmentResolveOptions(resolve, alias, preserveSymlinks, logg
|
|
53672
53687
|
...configDefaults.resolve,
|
53673
53688
|
mainFields: consumer === undefined || consumer === "client" || isSsrTargetWebworkerEnvironment ? DEFAULT_CLIENT_MAIN_FIELDS : DEFAULT_SERVER_MAIN_FIELDS,
|
53674
53689
|
conditions: consumer === undefined || consumer === "client" || isSsrTargetWebworkerEnvironment ? DEFAULT_CLIENT_CONDITIONS : DEFAULT_SERVER_CONDITIONS.filter((c) => c !== "browser"),
|
53675
|
-
builtins: resolve?.builtins ?? (consumer === "server"
|
53690
|
+
builtins: resolve?.builtins ?? (consumer === "server" ? isSsrTargetWebworkerEnvironment && resolve?.noExternal === true ? [] : nodeLikeBuiltins : [])
|
53676
53691
|
},
|
53677
53692
|
resolve ?? {}
|
53678
53693
|
);
|
@@ -53875,7 +53890,8 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
53875
53890
|
logger,
|
53876
53891
|
environmentName,
|
53877
53892
|
config.experimental?.skipSsrTransform,
|
53878
|
-
config.ssr?.target === "webworker"
|
53893
|
+
config.ssr?.target === "webworker",
|
53894
|
+
config.server?.preTransformRequests
|
53879
53895
|
);
|
53880
53896
|
}
|
53881
53897
|
const backwardCompatibleOptimizeDeps = resolvedEnvironments.client.optimizeDeps;
|
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-ChTE610F.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-ChTE610F.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-ChTE610F.js').then(function (n) { return n.T; });
|
843
843
|
const buildOptions = cleanGlobalCLIOptions(
|
844
844
|
cleanBuilderCLIOptions(options)
|
845
845
|
);
|
@@ -875,7 +875,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
875
875
|
).action(
|
876
876
|
async (root, options) => {
|
877
877
|
filterDuplicateOptions(options);
|
878
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
878
|
+
const { optimizeDeps } = await import('./chunks/dep-ChTE610F.js').then(function (n) { return n.R; });
|
879
879
|
try {
|
880
880
|
const config = await resolveConfig(
|
881
881
|
{
|
@@ -902,7 +902,7 @@ ${e.stack}`),
|
|
902
902
|
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(
|
903
903
|
async (root, options) => {
|
904
904
|
filterDuplicateOptions(options);
|
905
|
-
const { preview } = await import('./chunks/dep-
|
905
|
+
const { preview } = await import('./chunks/dep-ChTE610F.js').then(function (n) { return n.U; });
|
906
906
|
try {
|
907
907
|
const server = await preview({
|
908
908
|
root,
|
package/dist/node/constants.js
CHANGED
package/dist/node/index.d.ts
CHANGED
@@ -2618,7 +2618,7 @@ interface BuildEnvironmentOptions {
|
|
2618
2618
|
*/
|
2619
2619
|
copyPublicDir?: boolean;
|
2620
2620
|
/**
|
2621
|
-
* Whether to emit a .vite/manifest.json
|
2621
|
+
* Whether to emit a .vite/manifest.json in the output dir to map hash-less filenames
|
2622
2622
|
* to their hashed versions. Useful when you want to generate your own HTML
|
2623
2623
|
* instead of using the one generated by Vite.
|
2624
2624
|
*
|
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-ChTE610F.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-ChTE610F.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.1.0-beta.
|
3
|
+
"version": "6.1.0-beta.1",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -81,7 +81,7 @@
|
|
81
81
|
},
|
82
82
|
"devDependencies": {
|
83
83
|
"@ampproject/remapping": "^2.3.0",
|
84
|
-
"@babel/parser": "^7.26.
|
84
|
+
"@babel/parser": "^7.26.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",
|
@@ -116,7 +116,7 @@
|
|
116
116
|
"nanoid": "^5.0.9",
|
117
117
|
"open": "^10.1.0",
|
118
118
|
"parse5": "^7.2.1",
|
119
|
-
"pathe": "^2.0.
|
119
|
+
"pathe": "^2.0.2",
|
120
120
|
"periscopic": "^4.0.2",
|
121
121
|
"picocolors": "^1.1.1",
|
122
122
|
"picomatch": "^4.0.2",
|