vite 4.4.0-beta.0 → 4.4.0-beta.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.
- package/dist/node/chunks/{dep-f5e55821.js → dep-13ba4d1c.js} +24 -9
- package/dist/node/chunks/{dep-3f014a78.js → dep-ba2914dc.js} +1 -1
- package/dist/node/chunks/{dep-1a0ce392.js → dep-e5580ac6.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +2 -2
- package/package.json +3 -2
|
@@ -37104,7 +37104,7 @@ function htmlInlineProxyPlugin(config) {
|
|
|
37104
37104
|
const index = Number(proxyMatch[1]);
|
|
37105
37105
|
const file = cleanUrl(id);
|
|
37106
37106
|
const url = file.replace(normalizePath$3(config.root), '');
|
|
37107
|
-
const result = htmlProxyMap.get(config).get(url)[index];
|
|
37107
|
+
const result = htmlProxyMap.get(config).get(url)?.[index];
|
|
37108
37108
|
if (result) {
|
|
37109
37109
|
return result;
|
|
37110
37110
|
}
|
|
@@ -38663,8 +38663,8 @@ function createCachedImport(imp) {
|
|
|
38663
38663
|
return cached;
|
|
38664
38664
|
};
|
|
38665
38665
|
}
|
|
38666
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
|
38667
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
|
38666
|
+
const importPostcssImport = createCachedImport(() => import('./dep-ba2914dc.js').then(function (n) { return n.i; }));
|
|
38667
|
+
const importPostcssModules = createCachedImport(() => import('./dep-e5580ac6.js').then(function (n) { return n.i; }));
|
|
38668
38668
|
const importPostcss = createCachedImport(() => import('postcss'));
|
|
38669
38669
|
/**
|
|
38670
38670
|
* @experimental
|
|
@@ -40971,12 +40971,12 @@ function updateModules(file, modules, timestamp, { config, ws, moduleGraph }, af
|
|
|
40971
40971
|
const traversedModules = new Set();
|
|
40972
40972
|
let needFullReload = false;
|
|
40973
40973
|
for (const mod of modules) {
|
|
40974
|
-
|
|
40974
|
+
const boundaries = [];
|
|
40975
|
+
const hasDeadEnd = propagateUpdate(mod, traversedModules, boundaries);
|
|
40976
|
+
moduleGraph.invalidateModule(mod, invalidatedModules, timestamp, true, boundaries.map((b) => b.boundary));
|
|
40975
40977
|
if (needFullReload) {
|
|
40976
40978
|
continue;
|
|
40977
40979
|
}
|
|
40978
|
-
const boundaries = [];
|
|
40979
|
-
const hasDeadEnd = propagateUpdate(mod, traversedModules, boundaries);
|
|
40980
40980
|
if (hasDeadEnd) {
|
|
40981
40981
|
needFullReload = true;
|
|
40982
40982
|
continue;
|
|
@@ -55061,7 +55061,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
|
|
|
55061
55061
|
s.prependRight(topNode.start, `const ${id.name} = ${binding};\n`);
|
|
55062
55062
|
}
|
|
55063
55063
|
}
|
|
55064
|
-
else {
|
|
55064
|
+
else if (parent.type !== 'ClassExpression') {
|
|
55065
55065
|
s.update(id.start, id.end, binding);
|
|
55066
55066
|
}
|
|
55067
55067
|
},
|
|
@@ -62362,6 +62362,16 @@ function proxyMiddleware(httpServer, options, config) {
|
|
|
62362
62362
|
});
|
|
62363
62363
|
});
|
|
62364
62364
|
});
|
|
62365
|
+
// https://github.com/http-party/node-http-proxy/issues/1520#issue-877626125
|
|
62366
|
+
// https://github.com/chimurai/http-proxy-middleware/blob/cd58f962aec22c925b7df5140502978da8f87d5f/src/plugins/default/debug-proxy-errors-plugin.ts#L25-L37
|
|
62367
|
+
proxy.on('proxyRes', (proxyRes, req, res) => {
|
|
62368
|
+
res.on('close', () => {
|
|
62369
|
+
if (!res.writableEnded) {
|
|
62370
|
+
debug$1?.('destroying proxyRes in proxyRes close event');
|
|
62371
|
+
proxyRes.destroy();
|
|
62372
|
+
}
|
|
62373
|
+
});
|
|
62374
|
+
});
|
|
62365
62375
|
// clone before saving because http-proxy mutates the options
|
|
62366
62376
|
proxies[context] = [proxy, { ...opts }];
|
|
62367
62377
|
});
|
|
@@ -62835,6 +62845,7 @@ const processNodeUrl = (attr, sourceCodeLocation, s, config, htmlPath, originalU
|
|
|
62835
62845
|
const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl }) => {
|
|
62836
62846
|
const { config, moduleGraph, watcher } = server;
|
|
62837
62847
|
const base = config.base || '/';
|
|
62848
|
+
htmlPath = decodeURI(htmlPath);
|
|
62838
62849
|
let proxyModulePath;
|
|
62839
62850
|
let proxyModuleUrl;
|
|
62840
62851
|
const trailingSlash = htmlPath.endsWith('/');
|
|
@@ -63082,7 +63093,7 @@ class ModuleGraph {
|
|
|
63082
63093
|
});
|
|
63083
63094
|
}
|
|
63084
63095
|
}
|
|
63085
|
-
invalidateModule(mod, seen = new Set(), timestamp = Date.now(), isHmr = false) {
|
|
63096
|
+
invalidateModule(mod, seen = new Set(), timestamp = Date.now(), isHmr = false, hmrBoundaries = []) {
|
|
63086
63097
|
if (seen.has(mod)) {
|
|
63087
63098
|
return;
|
|
63088
63099
|
}
|
|
@@ -63101,6 +63112,10 @@ class ModuleGraph {
|
|
|
63101
63112
|
mod.ssrTransformResult = null;
|
|
63102
63113
|
mod.ssrModule = null;
|
|
63103
63114
|
mod.ssrError = null;
|
|
63115
|
+
// Fix #3033
|
|
63116
|
+
if (hmrBoundaries.includes(mod)) {
|
|
63117
|
+
return;
|
|
63118
|
+
}
|
|
63104
63119
|
mod.importers.forEach((importer) => {
|
|
63105
63120
|
if (!importer.acceptedHmrDeps.has(mod)) {
|
|
63106
63121
|
this.invalidateModule(importer, seen, timestamp, isHmr);
|
|
@@ -64534,7 +64549,7 @@ async function _createServer(inlineConfig = {}, options) {
|
|
|
64534
64549
|
},
|
|
64535
64550
|
openBrowser() {
|
|
64536
64551
|
const options = server.config.server;
|
|
64537
|
-
const url = server.resolvedUrls?.local[0];
|
|
64552
|
+
const url = server.resolvedUrls?.local[0] ?? server.resolvedUrls?.network[0];
|
|
64538
64553
|
if (url) {
|
|
64539
64554
|
const path = typeof options.open === 'string'
|
|
64540
64555
|
? new URL(options.open, url).href
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-
|
|
1
|
+
import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-13ba4d1c.js';
|
|
2
2
|
import require$$0__default 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 from 'node:fs';
|
|
3
3
|
import { performance } from 'node:perf_hooks';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
|
-
import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-13ba4d1c.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -728,7 +728,7 @@ cli
|
|
|
728
728
|
filterDuplicateOptions(options);
|
|
729
729
|
// output structure is preserved even after bundling so require()
|
|
730
730
|
// is ok here
|
|
731
|
-
const { createServer } = await import('./chunks/dep-
|
|
731
|
+
const { createServer } = await import('./chunks/dep-13ba4d1c.js').then(function (n) { return n.I; });
|
|
732
732
|
try {
|
|
733
733
|
const server = await createServer({
|
|
734
734
|
root,
|
|
@@ -806,7 +806,7 @@ cli
|
|
|
806
806
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
807
807
|
.action(async (root, options) => {
|
|
808
808
|
filterDuplicateOptions(options);
|
|
809
|
-
const { build } = await import('./chunks/dep-
|
|
809
|
+
const { build } = await import('./chunks/dep-13ba4d1c.js').then(function (n) { return n.H; });
|
|
810
810
|
const buildOptions = cleanOptions(options);
|
|
811
811
|
try {
|
|
812
812
|
await build({
|
|
@@ -834,7 +834,7 @@ cli
|
|
|
834
834
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
835
835
|
.action(async (root, options) => {
|
|
836
836
|
filterDuplicateOptions(options);
|
|
837
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
837
|
+
const { optimizeDeps } = await import('./chunks/dep-13ba4d1c.js').then(function (n) { return n.G; });
|
|
838
838
|
try {
|
|
839
839
|
const config = await resolveConfig({
|
|
840
840
|
root,
|
|
@@ -860,7 +860,7 @@ cli
|
|
|
860
860
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
861
861
|
.action(async (root, options) => {
|
|
862
862
|
filterDuplicateOptions(options);
|
|
863
|
-
const { preview } = await import('./chunks/dep-
|
|
863
|
+
const { preview } = await import('./chunks/dep-13ba4d1c.js').then(function (n) { return n.J; });
|
|
864
864
|
try {
|
|
865
865
|
const server = await preview({
|
|
866
866
|
root,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1403,7 +1403,7 @@ export declare class ModuleGraph {
|
|
|
1403
1403
|
getModuleById(id: string): ModuleNode | undefined;
|
|
1404
1404
|
getModulesByFile(file: string): Set<ModuleNode> | undefined;
|
|
1405
1405
|
onFileChange(file: string): void;
|
|
1406
|
-
invalidateModule(mod: ModuleNode, seen?: Set<ModuleNode>, timestamp?: number, isHmr?: boolean): void;
|
|
1406
|
+
invalidateModule(mod: ModuleNode, seen?: Set<ModuleNode>, timestamp?: number, isHmr?: boolean, hmrBoundaries?: ModuleNode[]): void;
|
|
1407
1407
|
invalidateAll(): void;
|
|
1408
1408
|
/**
|
|
1409
1409
|
* Update the module graph based on a module's updated imports information
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as isInNodeModules } from './chunks/dep-
|
|
2
|
-
export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
import { i as isInNodeModules } from './chunks/dep-13ba4d1c.js';
|
|
2
|
+
export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-13ba4d1c.js';
|
|
3
3
|
export { VERSION as version } from './constants.js';
|
|
4
4
|
export { version as esbuildVersion } from 'esbuild';
|
|
5
5
|
export { VERSION as rollupVersion } from 'rollup';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "4.4.0-beta.
|
|
3
|
+
"version": "4.4.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"url": "https://github.com/vitejs/vite/issues"
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://github.com/vitejs/vite/tree/main/#readme",
|
|
52
|
+
"funding": "https://github.com/vitejs/vite?sponsor=1",
|
|
52
53
|
"scripts": {
|
|
53
54
|
"dev": "rimraf dist && pnpm run build-bundle -w",
|
|
54
55
|
"build": "rimraf dist && run-s build-bundle build-types",
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
},
|
|
67
68
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
|
68
69
|
"dependencies": {
|
|
69
|
-
"esbuild": "^0.18.
|
|
70
|
+
"esbuild": "^0.18.6",
|
|
70
71
|
"postcss": "^8.4.24",
|
|
71
72
|
"rollup": "^3.21.0"
|
|
72
73
|
},
|