vite 4.0.0-beta.5 → 4.0.0-beta.7

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.
@@ -13392,8 +13392,6 @@ async function transformWithEsbuild(code, filename, options, inMap) {
13392
13392
  };
13393
13393
  }
13394
13394
  const resolvedOptions = {
13395
- // esbuild 0.16.0 & 0.16.1 defaults to 'browser': https://github.com/evanw/esbuild/issues/2718
13396
- platform: 'neutral',
13397
13395
  sourcemap: true,
13398
13396
  // ensure source file name contains full query
13399
13397
  sourcefile: filename,
@@ -22846,7 +22844,6 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
22846
22844
  if (data.exports) {
22847
22845
  entryPoint = resolveExports(data, '.', options, targetWeb);
22848
22846
  }
22849
- const resolvedFromExports = !!entryPoint;
22850
22847
  // if exports resolved to .mjs, still resolve other fields.
22851
22848
  // This is because .mjs files can technically import .cjs files which would
22852
22849
  // make them invalid for pure ESM environments - so if other module/browser
@@ -22889,9 +22886,7 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
22889
22886
  }
22890
22887
  }
22891
22888
  }
22892
- // fallback to mainFields if still not resolved
22893
- // TODO: review if `.mjs` check is still needed
22894
- if (!resolvedFromExports && (!entryPoint || entryPoint.endsWith('.mjs'))) {
22889
+ if (!entryPoint || entryPoint.endsWith('.mjs')) {
22895
22890
  for (const field of options.mainFields) {
22896
22891
  if (field === 'browser')
22897
22892
  continue; // already checked above
@@ -37613,7 +37608,7 @@ async function compileCSS(id, code, config, urlReplacer) {
37613
37608
  }));
37614
37609
  }
37615
37610
  if (isModule) {
37616
- postcssPlugins.unshift((await import('./dep-05d1f315.js').then(function (n) { return n.i; })).default({
37611
+ postcssPlugins.unshift((await import('./dep-ad878046.js').then(function (n) { return n.i; })).default({
37617
37612
  ...modulesOptions,
37618
37613
  localsConvention: modulesOptions?.localsConvention,
37619
37614
  getJSON(cssFileName, _modules, outputFileName) {
@@ -53121,6 +53116,17 @@ function rebindErrorStacktrace(e, stacktrace) {
53121
53116
  e.stack = stacktrace;
53122
53117
  }
53123
53118
  }
53119
+ const rewroteStacktraces = new WeakSet();
53120
+ function ssrFixStacktrace(e, moduleGraph) {
53121
+ if (!e.stack)
53122
+ return;
53123
+ // stacktrace shouldn't be rewritten more than once
53124
+ if (rewroteStacktraces.has(e))
53125
+ return;
53126
+ const stacktrace = ssrRewriteStacktrace(e.stack, moduleGraph);
53127
+ rebindErrorStacktrace(e, stacktrace);
53128
+ rewroteStacktraces.add(e);
53129
+ }
53124
53130
 
53125
53131
  const pendingModules = new Map();
53126
53132
  const pendingImports = new Map();
@@ -53241,9 +53247,8 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
53241
53247
  catch (e) {
53242
53248
  mod.ssrError = e;
53243
53249
  if (e.stack && fixStacktrace) {
53244
- const stacktrace = ssrRewriteStacktrace(e.stack, moduleGraph);
53245
- rebindErrorStacktrace(e, stacktrace);
53246
- server.config.logger.error(`Error when evaluating SSR module ${url}:\n${stacktrace}`, {
53250
+ ssrFixStacktrace(e, moduleGraph);
53251
+ server.config.logger.error(`Error when evaluating SSR module ${url}:\n${e.stack}`, {
53247
53252
  timestamp: true,
53248
53253
  clear: server.config.clearScreen,
53249
53254
  error: e,
@@ -54426,8 +54431,9 @@ function startBrowserProcess(browser, url) {
54426
54431
  }
54427
54432
 
54428
54433
  function bindShortcuts(server, opts) {
54429
- if (!server.httpServer)
54434
+ if (!server.httpServer || !process.stdin.isTTY || process.env.CI) {
54430
54435
  return;
54436
+ }
54431
54437
  server._shortcutsOptions = opts;
54432
54438
  if (opts.print) {
54433
54439
  server.config.logger.info(picocolors.exports.dim(picocolors.exports.green(' ➜')) +
@@ -54463,9 +54469,7 @@ function bindShortcuts(server, opts) {
54463
54469
  await shortcut.action(server);
54464
54470
  actionRunning = false;
54465
54471
  };
54466
- if (process.stdin.isTTY) {
54467
- process.stdin.setRawMode(true);
54468
- }
54472
+ process.stdin.setRawMode(true);
54469
54473
  process.stdin.on('data', onInput).setEncoding('utf8').resume();
54470
54474
  server.httpServer.on('close', () => {
54471
54475
  process.stdin.off('data', onInput).pause();
@@ -61920,10 +61924,7 @@ async function createServer(inlineConfig = {}) {
61920
61924
  return ssrLoadModule(url, server, undefined, undefined, opts?.fixStacktrace);
61921
61925
  },
61922
61926
  ssrFixStacktrace(e) {
61923
- if (e.stack) {
61924
- const stacktrace = ssrRewriteStacktrace(e.stack, moduleGraph);
61925
- rebindErrorStacktrace(e, stacktrace);
61926
- }
61927
+ ssrFixStacktrace(e, moduleGraph);
61927
61928
  },
61928
61929
  ssrRewriteStacktrace(stack) {
61929
61930
  return ssrRewriteStacktrace(stack, moduleGraph);
@@ -1,6 +1,6 @@
1
1
  import require$$0__default from 'fs';
2
2
  import require$$0 from 'postcss';
3
- import { C as commonjsGlobal } from './dep-4fae821a.js';
3
+ import { C as commonjsGlobal } from './dep-9ef48a42.js';
4
4
  import require$$0$1 from 'path';
5
5
  import require$$5 from 'crypto';
6
6
  import require$$0$2 from 'util';
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 { A as picocolors, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-4fae821a.js';
5
+ import { A as picocolors, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-9ef48a42.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:url';
8
8
  import 'node:module';
@@ -725,7 +725,7 @@ cli
725
725
  filterDuplicateOptions(options);
726
726
  // output structure is preserved even after bundling so require()
727
727
  // is ok here
728
- const { createServer } = await import('./chunks/dep-4fae821a.js').then(function (n) { return n.F; });
728
+ const { createServer } = await import('./chunks/dep-9ef48a42.js').then(function (n) { return n.F; });
729
729
  try {
730
730
  const server = await createServer({
731
731
  root,
@@ -804,7 +804,7 @@ cli
804
804
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
805
805
  .action(async (root, options) => {
806
806
  filterDuplicateOptions(options);
807
- const { build } = await import('./chunks/dep-4fae821a.js').then(function (n) { return n.E; });
807
+ const { build } = await import('./chunks/dep-9ef48a42.js').then(function (n) { return n.E; });
808
808
  const buildOptions = cleanOptions(options);
809
809
  try {
810
810
  await build({
@@ -832,7 +832,7 @@ cli
832
832
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
833
833
  .action(async (root, options) => {
834
834
  filterDuplicateOptions(options);
835
- const { optimizeDeps } = await import('./chunks/dep-4fae821a.js').then(function (n) { return n.D; });
835
+ const { optimizeDeps } = await import('./chunks/dep-9ef48a42.js').then(function (n) { return n.D; });
836
836
  try {
837
837
  const config = await resolveConfig({
838
838
  root,
@@ -857,7 +857,7 @@ cli
857
857
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
858
858
  .action(async (root, options) => {
859
859
  filterDuplicateOptions(options);
860
- const { preview } = await import('./chunks/dep-4fae821a.js').then(function (n) { return n.G; });
860
+ const { preview } = await import('./chunks/dep-9ef48a42.js').then(function (n) { return n.G; });
861
861
  try {
862
862
  const server = await preview({
863
863
  root,
@@ -1,4 +1,4 @@
1
- export { b as build, e as buildErrorMessage, u as createFilter, w as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, j as getDepOptimizationConfig, k as isDepsOptimizerEnabled, l as loadConfigFromFile, y as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, i as resolveBaseUrl, h as resolveConfig, z as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, x as searchForWorkspaceRoot, v as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-4fae821a.js';
1
+ export { b as build, e as buildErrorMessage, u as createFilter, w as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, j as getDepOptimizationConfig, k as isDepsOptimizerEnabled, l as loadConfigFromFile, y as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, i as resolveBaseUrl, h as resolveConfig, z as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, x as searchForWorkspaceRoot, v as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-9ef48a42.js';
2
2
  export { VERSION as version } from './constants.js';
3
3
  export { version as esbuildVersion } from 'esbuild';
4
4
  export { VERSION as rollupVersion } from 'rollup';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "4.0.0-beta.5",
3
+ "version": "4.0.0-beta.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -58,10 +58,10 @@
58
58
  },
59
59
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
60
60
  "dependencies": {
61
- "esbuild": "^0.16.1",
61
+ "esbuild": "^0.16.2",
62
62
  "postcss": "^8.4.19",
63
63
  "resolve": "^1.22.1",
64
- "rollup": "^3.6.0"
64
+ "rollup": "^3.7.0"
65
65
  },
66
66
  "optionalDependencies": {
67
67
  "fsevents": "~2.3.2"