vite 4.4.0-beta.1 → 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.

@@ -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-09ad63bf.js').then(function (n) { return n.i; }));
38667
- const importPostcssModules = createCachedImport(() => import('./dep-123224c3.js').then(function (n) { return n.i; }));
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
- moduleGraph.invalidateModule(mod, invalidatedModules, timestamp, true);
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;
@@ -62845,6 +62845,7 @@ const processNodeUrl = (attr, sourceCodeLocation, s, config, htmlPath, originalU
62845
62845
  const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl }) => {
62846
62846
  const { config, moduleGraph, watcher } = server;
62847
62847
  const base = config.base || '/';
62848
+ htmlPath = decodeURI(htmlPath);
62848
62849
  let proxyModulePath;
62849
62850
  let proxyModuleUrl;
62850
62851
  const trailingSlash = htmlPath.endsWith('/');
@@ -63092,7 +63093,7 @@ class ModuleGraph {
63092
63093
  });
63093
63094
  }
63094
63095
  }
63095
- invalidateModule(mod, seen = new Set(), timestamp = Date.now(), isHmr = false) {
63096
+ invalidateModule(mod, seen = new Set(), timestamp = Date.now(), isHmr = false, hmrBoundaries = []) {
63096
63097
  if (seen.has(mod)) {
63097
63098
  return;
63098
63099
  }
@@ -63111,6 +63112,10 @@ class ModuleGraph {
63111
63112
  mod.ssrTransformResult = null;
63112
63113
  mod.ssrModule = null;
63113
63114
  mod.ssrError = null;
63115
+ // Fix #3033
63116
+ if (hmrBoundaries.includes(mod)) {
63117
+ return;
63118
+ }
63114
63119
  mod.importers.forEach((importer) => {
63115
63120
  if (!importer.acceptedHmrDeps.has(mod)) {
63116
63121
  this.invalidateModule(importer, seen, timestamp, isHmr);
@@ -1,4 +1,4 @@
1
- import { E as getDefaultExportFromCjs } from './dep-f23e3cf1.js';
1
+ import { E as getDefaultExportFromCjs } from './dep-13ba4d1c.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-c423598f.js';
@@ -1,4 +1,4 @@
1
- import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-f23e3cf1.js';
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-f23e3cf1.js';
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-f23e3cf1.js').then(function (n) { return n.I; });
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-f23e3cf1.js').then(function (n) { return n.H; });
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-f23e3cf1.js').then(function (n) { return n.G; });
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-f23e3cf1.js').then(function (n) { return n.J; });
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,
@@ -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
@@ -1,5 +1,5 @@
1
- import { i as isInNodeModules } from './chunks/dep-f23e3cf1.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-f23e3cf1.js';
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.1",
3
+ "version": "4.4.0-beta.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",