vite 4.3.7 → 4.3.8

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.

@@ -38572,8 +38572,8 @@ function createCachedImport(imp) {
38572
38572
  return cached;
38573
38573
  };
38574
38574
  }
38575
- const importPostcssImport = createCachedImport(() => import('./dep-7c975f20.js').then(function (n) { return n.i; }));
38576
- const importPostcssModules = createCachedImport(() => import('./dep-a6949a9d.js').then(function (n) { return n.i; }));
38575
+ const importPostcssImport = createCachedImport(() => import('./dep-92b9cc25.js').then(function (n) { return n.i; }));
38576
+ const importPostcssModules = createCachedImport(() => import('./dep-5500f506.js').then(function (n) { return n.i; }));
38577
38577
  const importPostcss = createCachedImport(() => import('postcss'));
38578
38578
  /**
38579
38579
  * @experimental
@@ -40453,9 +40453,9 @@ function importAnalysisPlugin(config) {
40453
40453
  // since we are already in the transform phase of the importer, it must
40454
40454
  // have been loaded so its entry is guaranteed in the module graph.
40455
40455
  const importerModule = moduleGraph.getModuleById(importer);
40456
- if (!importerModule && depsOptimizer?.isOptimizedDepFile(importer)) {
40457
- // Ids of optimized deps could be invalidated and removed from the graph
40458
- // Return without transforming, this request is no longer valid, a full reload
40456
+ if (!importerModule) {
40457
+ // When the server is restarted, the module graph is cleared, so we
40458
+ // return without transforming. This request is no longer valid, a full reload
40459
40459
  // is going to request this id again. Throwing an outdated error so we
40460
40460
  // properly finish the request with a 504 sent to the browser.
40461
40461
  throwOutdatedRequest(importer);
@@ -61611,6 +61611,9 @@ function getHtmlFilename(url, server) {
61611
61611
  return decodeURIComponent(normalizePath$3(path$o.join(server.config.root, url.slice(1))));
61612
61612
  }
61613
61613
  }
61614
+ function shouldPreTransform(url, config) {
61615
+ return (!checkPublicFile(url, config) && (isJSRequest(url) || isCSSRequest(url)));
61616
+ }
61614
61617
  const processNodeUrl = (attr, sourceCodeLocation, s, config, htmlPath, originalUrl, server) => {
61615
61618
  let url = attr.value || '';
61616
61619
  if (server?.moduleGraph) {
@@ -61624,7 +61627,7 @@ const processNodeUrl = (attr, sourceCodeLocation, s, config, htmlPath, originalU
61624
61627
  // prefix with base (dev only, base is never relative)
61625
61628
  const fullUrl = path$o.posix.join(devBase, url);
61626
61629
  overwriteAttrValue(s, sourceCodeLocation, fullUrl);
61627
- if (server && !checkPublicFile(url, config)) {
61630
+ if (server && shouldPreTransform(url, config)) {
61628
61631
  preTransformRequest(server, fullUrl, devBase);
61629
61632
  }
61630
61633
  }
@@ -61635,7 +61638,7 @@ const processNodeUrl = (attr, sourceCodeLocation, s, config, htmlPath, originalU
61635
61638
  // prefix with base (dev only, base is never relative)
61636
61639
  const replacer = (url) => {
61637
61640
  const fullUrl = path$o.posix.join(devBase, url);
61638
- if (server && !checkPublicFile(url, config)) {
61641
+ if (server && shouldPreTransform(url, config)) {
61639
61642
  preTransformRequest(server, fullUrl, devBase);
61640
61643
  }
61641
61644
  return fullUrl;
@@ -63305,7 +63308,9 @@ async function _createServer(inlineConfig = {}, options) {
63305
63308
  if (isDepsOptimizerEnabled(config, true)) {
63306
63309
  await initDevSsrDepsOptimizer(config, server);
63307
63310
  }
63308
- await updateCjsSsrExternals(server);
63311
+ if (config.legacy?.buildSsrCjsExternalHeuristics) {
63312
+ await updateCjsSsrExternals(server);
63313
+ }
63309
63314
  return ssrLoadModule(url, server, undefined, undefined, opts?.fixStacktrace);
63310
63315
  },
63311
63316
  ssrFixStacktrace(e) {
@@ -1,4 +1,4 @@
1
- import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-1f986b87.js';
1
+ import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-4d3eff22.js';
2
2
  import require$$0__default from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
@@ -1,4 +1,4 @@
1
- import { E as getDefaultExportFromCjs } from './dep-1f986b87.js';
1
+ import { E as getDefaultExportFromCjs } from './dep-4d3eff22.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';
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-1f986b87.js';
5
+ import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-4d3eff22.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-1f986b87.js').then(function (n) { return n.I; });
731
+ const { createServer } = await import('./chunks/dep-4d3eff22.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-1f986b87.js').then(function (n) { return n.H; });
809
+ const { build } = await import('./chunks/dep-4d3eff22.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-1f986b87.js').then(function (n) { return n.G; });
837
+ const { optimizeDeps } = await import('./chunks/dep-4d3eff22.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-1f986b87.js').then(function (n) { return n.J; });
863
+ const { preview } = await import('./chunks/dep-4d3eff22.js').then(function (n) { return n.J; });
864
864
  try {
865
865
  const server = await preview({
866
866
  root,
@@ -1,5 +1,5 @@
1
- import { i as isInNodeModules } from './chunks/dep-1f986b87.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-1f986b87.js';
1
+ import { i as isInNodeModules } from './chunks/dep-4d3eff22.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-4d3eff22.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.3.7",
3
+ "version": "4.3.8",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",