vite 4.0.1 → 4.0.3

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/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-2285ba4f.js';
5
+ import { A as picocolorsExports, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-0bae2027.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:url';
8
8
  import 'node:module';
@@ -663,7 +663,7 @@ const stopProfiler = (log) => {
663
663
  if (!err) {
664
664
  const outPath = path.resolve(`./vite-profile-${profileCount++}.cpuprofile`);
665
665
  fs.writeFileSync(outPath, JSON.stringify(profile));
666
- log(picocolors.exports.yellow(`CPU profile written to ${picocolors.exports.white(picocolors.exports.dim(outPath))}`));
666
+ log(picocolorsExports.yellow(`CPU profile written to ${picocolorsExports.white(picocolorsExports.dim(outPath))}`));
667
667
  profileSession = undefined;
668
668
  res();
669
669
  }
@@ -724,7 +724,7 @@ cli
724
724
  filterDuplicateOptions(options);
725
725
  // output structure is preserved even after bundling so require()
726
726
  // is ok here
727
- const { createServer } = await import('./chunks/dep-2285ba4f.js').then(function (n) { return n.F; });
727
+ const { createServer } = await import('./chunks/dep-0bae2027.js').then(function (n) { return n.F; });
728
728
  try {
729
729
  const server = await createServer({
730
730
  root,
@@ -743,9 +743,9 @@ cli
743
743
  const info = server.config.logger.info;
744
744
  const viteStartTime = global.__vite_start_time ?? false;
745
745
  const startupDurationString = viteStartTime
746
- ? picocolors.exports.dim(`ready in ${picocolors.exports.reset(picocolors.exports.bold(Math.ceil(performance.now() - viteStartTime)))} ms`)
746
+ ? picocolorsExports.dim(`ready in ${picocolorsExports.reset(picocolorsExports.bold(Math.ceil(performance.now() - viteStartTime)))} ms`)
747
747
  : '';
748
- info(`\n ${picocolors.exports.green(`${picocolors.exports.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, { clear: !server.config.logger.hasWarned });
748
+ info(`\n ${picocolorsExports.green(`${picocolorsExports.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, { clear: !server.config.logger.hasWarned });
749
749
  server.printUrls();
750
750
  bindShortcuts(server, {
751
751
  print: true,
@@ -777,7 +777,7 @@ cli
777
777
  }
778
778
  catch (e) {
779
779
  const logger = createLogger(options.logLevel);
780
- logger.error(picocolors.exports.red(`error when starting dev server:\n${e.stack}`), {
780
+ logger.error(picocolorsExports.red(`error when starting dev server:\n${e.stack}`), {
781
781
  error: e,
782
782
  });
783
783
  stopProfiler(logger.info);
@@ -802,7 +802,7 @@ cli
802
802
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
803
803
  .action(async (root, options) => {
804
804
  filterDuplicateOptions(options);
805
- const { build } = await import('./chunks/dep-2285ba4f.js').then(function (n) { return n.E; });
805
+ const { build } = await import('./chunks/dep-0bae2027.js').then(function (n) { return n.E; });
806
806
  const buildOptions = cleanOptions(options);
807
807
  try {
808
808
  await build({
@@ -817,7 +817,7 @@ cli
817
817
  });
818
818
  }
819
819
  catch (e) {
820
- createLogger(options.logLevel).error(picocolors.exports.red(`error during build:\n${e.stack}`), { error: e });
820
+ createLogger(options.logLevel).error(picocolorsExports.red(`error during build:\n${e.stack}`), { error: e });
821
821
  process.exit(1);
822
822
  }
823
823
  finally {
@@ -830,18 +830,18 @@ cli
830
830
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
831
831
  .action(async (root, options) => {
832
832
  filterDuplicateOptions(options);
833
- const { optimizeDeps } = await import('./chunks/dep-2285ba4f.js').then(function (n) { return n.D; });
833
+ const { optimizeDeps } = await import('./chunks/dep-0bae2027.js').then(function (n) { return n.D; });
834
834
  try {
835
835
  const config = await resolveConfig({
836
836
  root,
837
837
  base: options.base,
838
838
  configFile: options.config,
839
839
  logLevel: options.logLevel,
840
- }, 'build');
840
+ }, 'serve');
841
841
  await optimizeDeps(config, options.force, true);
842
842
  }
843
843
  catch (e) {
844
- createLogger(options.logLevel).error(picocolors.exports.red(`error when optimizing deps:\n${e.stack}`), { error: e });
844
+ createLogger(options.logLevel).error(picocolorsExports.red(`error when optimizing deps:\n${e.stack}`), { error: e });
845
845
  process.exit(1);
846
846
  }
847
847
  });
@@ -855,7 +855,7 @@ cli
855
855
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
856
856
  .action(async (root, options) => {
857
857
  filterDuplicateOptions(options);
858
- const { preview } = await import('./chunks/dep-2285ba4f.js').then(function (n) { return n.G; });
858
+ const { preview } = await import('./chunks/dep-0bae2027.js').then(function (n) { return n.G; });
859
859
  try {
860
860
  const server = await preview({
861
861
  root,
@@ -877,7 +877,7 @@ cli
877
877
  server.printUrls();
878
878
  }
879
879
  catch (e) {
880
- createLogger(options.logLevel).error(picocolors.exports.red(`error when starting preview server:\n${e.stack}`), { error: e });
880
+ createLogger(options.logLevel).error(picocolorsExports.red(`error when starting preview server:\n${e.stack}`), { error: e });
881
881
  process.exit(1);
882
882
  }
883
883
  finally {
@@ -2647,7 +2647,7 @@ export declare interface WatchOptions {
2647
2647
 
2648
2648
  /**
2649
2649
  * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
2650
- * and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on
2650
+ * and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
2651
2651
  * OS X, `usePolling: true` becomes the default.
2652
2652
  */
2653
2653
  useFsEvents?: boolean
@@ -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-2285ba4f.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-0bae2027.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';
@@ -157,7 +157,11 @@ function getDefaultExportFromCjs (x) {
157
157
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
158
158
  }
159
159
 
160
- var picocolors = {exports: {}};
160
+ var picocolorsExports = {};
161
+ var picocolors = {
162
+ get exports(){ return picocolorsExports; },
163
+ set exports(v){ picocolorsExports = v; },
164
+ };
161
165
 
162
166
  let tty = require$$0;
163
167
 
@@ -216,11 +220,19 @@ let createColors = (enabled = isColorSupported) => ({
216
220
  });
217
221
 
218
222
  picocolors.exports = createColors();
219
- picocolors.exports.createColors = createColors;
223
+ picocolorsExports.createColors = createColors;
220
224
 
221
- var src = {exports: {}};
225
+ var srcExports = {};
226
+ var src = {
227
+ get exports(){ return srcExports; },
228
+ set exports(v){ srcExports = v; },
229
+ };
222
230
 
223
- var browser = {exports: {}};
231
+ var browserExports = {};
232
+ var browser = {
233
+ get exports(){ return browserExports; },
234
+ set exports(v){ browserExports = v; },
235
+ };
224
236
 
225
237
  /**
226
238
  * Helpers.
@@ -680,7 +692,7 @@ function requireCommon () {
680
692
  var hasRequiredBrowser;
681
693
 
682
694
  function requireBrowser () {
683
- if (hasRequiredBrowser) return browser.exports;
695
+ if (hasRequiredBrowser) return browserExports;
684
696
  hasRequiredBrowser = 1;
685
697
  (function (module, exports) {
686
698
  /**
@@ -950,11 +962,15 @@ function requireBrowser () {
950
962
  return '[UnexpectedJSONParseError]: ' + error.message;
951
963
  }
952
964
  };
953
- } (browser, browser.exports));
954
- return browser.exports;
965
+ } (browser, browserExports));
966
+ return browserExports;
955
967
  }
956
968
 
957
- var node = {exports: {}};
969
+ var nodeExports = {};
970
+ var node = {
971
+ get exports(){ return nodeExports; },
972
+ set exports(v){ nodeExports = v; },
973
+ };
958
974
 
959
975
  /**
960
976
  * Module dependencies.
@@ -963,7 +979,7 @@ var node = {exports: {}};
963
979
  var hasRequiredNode;
964
980
 
965
981
  function requireNode () {
966
- if (hasRequiredNode) return node.exports;
982
+ if (hasRequiredNode) return nodeExports;
967
983
  hasRequiredNode = 1;
968
984
  (function (module, exports) {
969
985
  const tty = require$$0;
@@ -1225,8 +1241,8 @@ function requireNode () {
1225
1241
  this.inspectOpts.colors = this.useColors;
1226
1242
  return util.inspect(v, this.inspectOpts);
1227
1243
  };
1228
- } (node, node.exports));
1229
- return node.exports;
1244
+ } (node, nodeExports));
1245
+ return nodeExports;
1230
1246
  }
1231
1247
 
1232
1248
  /**
@@ -1242,9 +1258,13 @@ function requireNode () {
1242
1258
  }
1243
1259
  } (src));
1244
1260
 
1245
- var debug = /*@__PURE__*/getDefaultExportFromCjs(src.exports);
1261
+ var debug = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
1246
1262
 
1247
- var picomatch$1 = {exports: {}};
1263
+ var picomatchExports = {};
1264
+ var picomatch$1 = {
1265
+ get exports(){ return picomatchExports; },
1266
+ set exports(v){ picomatchExports = v; },
1267
+ };
1248
1268
 
1249
1269
  var utils$3 = {};
1250
1270
 
@@ -3311,7 +3331,7 @@ var picomatch_1 = picomatch;
3311
3331
  module.exports = picomatch_1;
3312
3332
  } (picomatch$1));
3313
3333
 
3314
- var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatch$1.exports);
3334
+ var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatchExports);
3315
3335
 
3316
3336
  // Helper since Typescript can't detect readonly arrays with Array.isArray
3317
3337
  function isArray(arg) {
@@ -3836,11 +3856,11 @@ function createLogger(level = 'info', options = {}) {
3836
3856
  const format = () => {
3837
3857
  if (options.timestamp) {
3838
3858
  const tag = type === 'info'
3839
- ? picocolors.exports.cyan(picocolors.exports.bold(prefix))
3859
+ ? picocolorsExports.cyan(picocolorsExports.bold(prefix))
3840
3860
  : type === 'warn'
3841
- ? picocolors.exports.yellow(picocolors.exports.bold(prefix))
3842
- : picocolors.exports.red(picocolors.exports.bold(prefix));
3843
- return `${picocolors.exports.dim(new Date().toLocaleTimeString())} ${tag} ${msg}`;
3861
+ ? picocolorsExports.yellow(picocolorsExports.bold(prefix))
3862
+ : picocolorsExports.red(picocolorsExports.bold(prefix));
3863
+ return `${picocolorsExports.dim(new Date().toLocaleTimeString())} ${tag} ${msg}`;
3844
3864
  }
3845
3865
  else {
3846
3866
  return msg;
@@ -3853,7 +3873,7 @@ function createLogger(level = 'info', options = {}) {
3853
3873
  if (type === lastType && msg === lastMsg) {
3854
3874
  sameCount++;
3855
3875
  clear();
3856
- console[method](format(), picocolors.exports.yellow(`(x${sameCount + 1})`));
3876
+ console[method](format(), picocolorsExports.yellow(`(x${sameCount + 1})`));
3857
3877
  }
3858
3878
  else {
3859
3879
  sameCount = 0;
@@ -3960,7 +3980,11 @@ function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
3960
3980
  return searchForWorkspaceRoot(dir, root);
3961
3981
  }
3962
3982
 
3963
- var main$1 = {exports: {}};
3983
+ var mainExports = {};
3984
+ var main$1 = {
3985
+ get exports(){ return mainExports; },
3986
+ set exports(v){ mainExports = v; },
3987
+ };
3964
3988
 
3965
3989
  var name = "dotenv";
3966
3990
  var version$1 = "16.0.3";
@@ -4145,8 +4169,8 @@ const DotenvModule = {
4145
4169
  parse
4146
4170
  };
4147
4171
 
4148
- main$1.exports.config = DotenvModule.config;
4149
- var parse_1 = main$1.exports.parse = DotenvModule.parse;
4172
+ mainExports.config = DotenvModule.config;
4173
+ var parse_1 = mainExports.parse = DotenvModule.parse;
4150
4174
  main$1.exports = DotenvModule;
4151
4175
 
4152
4176
  function _interpolate (envValue, environment, config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -52,6 +52,7 @@
52
52
  "build-types-roll": "api-extractor run && rimraf temp",
53
53
  "build-types-post-patch": "tsx scripts/postPatchTypes.ts",
54
54
  "build-types-check": "tsx scripts/checkBuiltTypes.ts && tsc --project tsconfig.check.json",
55
+ "typecheck": "tsc --noEmit",
55
56
  "lint": "eslint --cache --ext .ts src/**",
56
57
  "format": "prettier --write --cache --parser typescript \"src/**/*.ts\"",
57
58
  "prepublishOnly": "npm run build"
@@ -72,7 +73,7 @@
72
73
  "@babel/types": "^7.20.5",
73
74
  "@jridgewell/trace-mapping": "^0.3.17",
74
75
  "@rollup/plugin-alias": "^4.0.2",
75
- "@rollup/plugin-commonjs": "^23.0.4",
76
+ "@rollup/plugin-commonjs": "^24.0.0",
76
77
  "@rollup/plugin-dynamic-import-vars": "^2.0.1",
77
78
  "@rollup/plugin-json": "^5.0.2",
78
79
  "@rollup/plugin-node-resolve": "15.0.1",
@@ -84,7 +85,7 @@
84
85
  "chokidar": "^3.5.3",
85
86
  "connect": "^3.7.0",
86
87
  "connect-history-api-fallback": "^2.0.0",
87
- "convert-source-map": "^1.9.0",
88
+ "convert-source-map": "^2.0.0",
88
89
  "cors": "^2.8.5",
89
90
  "cross-spawn": "^7.0.3",
90
91
  "debug": "^4.3.4",
@@ -99,7 +100,7 @@
99
100
  "launch-editor-middleware": "^2.6.0",
100
101
  "magic-string": "^0.27.0",
101
102
  "micromatch": "^4.0.5",
102
- "mlly": "^0.5.17",
103
+ "mlly": "^1.0.0",
103
104
  "mrmime": "^1.0.1",
104
105
  "okie": "^1.0.1",
105
106
  "open": "^8.4.0",
@@ -111,6 +112,7 @@
111
112
  "postcss-load-config": "^4.0.1",
112
113
  "postcss-modules": "^6.0.0",
113
114
  "resolve.exports": "^1.1.0",
115
+ "rollup-plugin-license": "^3.0.1",
114
116
  "sirv": "^2.0.2",
115
117
  "source-map-js": "^1.0.2",
116
118
  "source-map-support": "^0.5.21",
@@ -119,7 +121,7 @@
119
121
  "tsconfck": "^2.0.1",
120
122
  "tslib": "^2.4.1",
121
123
  "types": "link:./types",
122
- "ufo": "^0.8.6",
124
+ "ufo": "^1.0.1",
123
125
  "ws": "^8.11.0"
124
126
  },
125
127
  "peerDependencies": {