vite 5.3.0-beta.2 → 5.3.0
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/client.d.ts +4 -0
- package/dist/client/client.mjs +1 -1
- package/dist/node/chunks/{dep-CkqaOKeN.js → dep-C-hCBY92.js} +1 -1
- package/dist/node/chunks/{dep-E0jGEM7W.js → dep-DfBmsS12.js} +1 -1
- package/dist/node/chunks/{dep-DxsHXWQ1.js → dep-h78lQ5BT.js} +29 -9
- package/dist/node/cli.js +5 -5
- package/dist/node/constants.js +1 -0
- package/dist/node/index.js +2 -2
- package/package.json +1 -1
package/client.d.ts
CHANGED
package/dist/client/client.mjs
CHANGED
@@ -553,7 +553,7 @@ function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) {
|
|
553
553
|
}
|
554
554
|
notifyListeners("vite:ws:disconnect", { webSocket: socket2 });
|
555
555
|
if (hasDocument) {
|
556
|
-
console.log(`[vite] server connection lost.
|
556
|
+
console.log(`[vite] server connection lost. Polling for restart...`);
|
557
557
|
await waitForSuccessfulPing(protocol, hostAndPath);
|
558
558
|
location.reload();
|
559
559
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-h78lQ5BT.js';
|
2
2
|
import require$$0__default from 'fs';
|
3
3
|
import require$$0 from 'postcss';
|
4
4
|
import require$$0$1 from 'path';
|
@@ -36575,8 +36575,8 @@ function createCachedImport(imp) {
|
|
36575
36575
|
return cached;
|
36576
36576
|
};
|
36577
36577
|
}
|
36578
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
36579
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
36578
|
+
const importPostcssImport = createCachedImport(() => import('./dep-DfBmsS12.js').then(function (n) { return n.i; }));
|
36579
|
+
const importPostcssModules = createCachedImport(() => import('./dep-C-hCBY92.js').then(function (n) { return n.i; }));
|
36580
36580
|
const importPostcss = createCachedImport(() => import('postcss'));
|
36581
36581
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
36582
36582
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -52858,17 +52858,29 @@ Object.defineProperty(${ssrModuleExportsKey}, "${name}", { enumerable: true, con
|
|
52858
52858
|
if (node.type === "ImportDeclaration") {
|
52859
52859
|
const importId = defineImport(hoistIndex, node.source.value, {
|
52860
52860
|
importedNames: node.specifiers.map((s2) => {
|
52861
|
-
if (s2.type === "ImportSpecifier")
|
52861
|
+
if (s2.type === "ImportSpecifier")
|
52862
|
+
return s2.imported.type === "Identifier" ? s2.imported.name : (
|
52863
|
+
// @ts-expect-error TODO: Estree types don't consider arbitrary module namespace specifiers yet
|
52864
|
+
s2.imported.value
|
52865
|
+
);
|
52862
52866
|
else if (s2.type === "ImportDefaultSpecifier") return "default";
|
52863
52867
|
}).filter(isDefined)
|
52864
52868
|
});
|
52865
52869
|
s.remove(node.start, node.end);
|
52866
52870
|
for (const spec of node.specifiers) {
|
52867
52871
|
if (spec.type === "ImportSpecifier") {
|
52868
|
-
|
52869
|
-
|
52870
|
-
|
52871
|
-
|
52872
|
+
if (spec.imported.type === "Identifier") {
|
52873
|
+
idToImportMap.set(
|
52874
|
+
spec.local.name,
|
52875
|
+
`${importId}.${spec.imported.name}`
|
52876
|
+
);
|
52877
|
+
} else {
|
52878
|
+
idToImportMap.set(
|
52879
|
+
spec.local.name,
|
52880
|
+
`${importId}[${// @ts-expect-error TODO: Estree types don't consider arbitrary module namespace specifiers yet
|
52881
|
+
JSON.stringify(spec.imported.value)}]`
|
52882
|
+
);
|
52883
|
+
}
|
52872
52884
|
} else if (spec.type === "ImportDefaultSpecifier") {
|
52873
52885
|
idToImportMap.set(spec.local.name, `${importId}.default`);
|
52874
52886
|
} else {
|
@@ -52902,9 +52914,13 @@ Object.defineProperty(${ssrModuleExportsKey}, "${name}", { enumerable: true, con
|
|
52902
52914
|
}
|
52903
52915
|
);
|
52904
52916
|
for (const spec of node.specifiers) {
|
52917
|
+
const exportedAs = spec.exported.type === "Identifier" ? spec.exported.name : (
|
52918
|
+
// @ts-expect-error TODO: Estree types don't consider arbitrary module namespace specifiers yet
|
52919
|
+
spec.exported.value
|
52920
|
+
);
|
52905
52921
|
defineExport(
|
52906
52922
|
node.start,
|
52907
|
-
|
52923
|
+
exportedAs,
|
52908
52924
|
`${importId}.${spec.local.name}`
|
52909
52925
|
);
|
52910
52926
|
}
|
@@ -52912,7 +52928,11 @@ Object.defineProperty(${ssrModuleExportsKey}, "${name}", { enumerable: true, con
|
|
52912
52928
|
for (const spec of node.specifiers) {
|
52913
52929
|
const local = spec.local.name;
|
52914
52930
|
const binding = idToImportMap.get(local);
|
52915
|
-
|
52931
|
+
const exportedAs = spec.exported.type === "Identifier" ? spec.exported.name : (
|
52932
|
+
// @ts-expect-error TODO: Estree types don't consider arbitrary module namespace specifiers yet
|
52933
|
+
spec.exported.value
|
52934
|
+
);
|
52935
|
+
defineExport(node.end, exportedAs, binding || local);
|
52916
52936
|
}
|
52917
52937
|
}
|
52918
52938
|
}
|
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-h78lQ5BT.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-h78lQ5BT.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-h78lQ5BT.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-h78lQ5BT.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-h78lQ5BT.js').then(function (n) { return n.G; });
|
881
881
|
try {
|
882
882
|
const server = await preview({
|
883
883
|
root,
|
package/dist/node/constants.js
CHANGED
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-h78lQ5BT.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-h78lQ5BT.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';
|