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

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
- import { E as getDefaultExportFromCjs } from './dep-f5e55821.js';
1
+ import { E as getDefaultExportFromCjs } from './dep-f23e3cf1.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-f5e55821.js';
1
+ import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-f23e3cf1.js';
2
2
  import require$$0__default from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
@@ -38663,8 +38663,8 @@ function createCachedImport(imp) {
38663
38663
  return cached;
38664
38664
  };
38665
38665
  }
38666
- const importPostcssImport = createCachedImport(() => import('./dep-3f014a78.js').then(function (n) { return n.i; }));
38667
- const importPostcssModules = createCachedImport(() => import('./dep-1a0ce392.js').then(function (n) { return n.i; }));
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; }));
38668
38668
  const importPostcss = createCachedImport(() => import('postcss'));
38669
38669
  /**
38670
38670
  * @experimental
@@ -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
  });
@@ -64534,7 +64544,7 @@ async function _createServer(inlineConfig = {}, options) {
64534
64544
  },
64535
64545
  openBrowser() {
64536
64546
  const options = server.config.server;
64537
- const url = server.resolvedUrls?.local[0];
64547
+ const url = server.resolvedUrls?.local[0] ?? server.resolvedUrls?.network[0];
64538
64548
  if (url) {
64539
64549
  const path = typeof options.open === 'string'
64540
64550
  ? new URL(options.open, url).href
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-f5e55821.js';
5
+ import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-f23e3cf1.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-f5e55821.js').then(function (n) { return n.I; });
731
+ const { createServer } = await import('./chunks/dep-f23e3cf1.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-f5e55821.js').then(function (n) { return n.H; });
809
+ const { build } = await import('./chunks/dep-f23e3cf1.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-f5e55821.js').then(function (n) { return n.G; });
837
+ const { optimizeDeps } = await import('./chunks/dep-f23e3cf1.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-f5e55821.js').then(function (n) { return n.J; });
863
+ const { preview } = await import('./chunks/dep-f23e3cf1.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-f5e55821.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-f5e55821.js';
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';
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.0",
3
+ "version": "4.4.0-beta.1",
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.2",
70
+ "esbuild": "^0.18.6",
70
71
  "postcss": "^8.4.24",
71
72
  "rollup": "^3.21.0"
72
73
  },