vite 4.4.7 → 4.4.9

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-3b8eb186.js';
1
+ import { E as getDefaultExportFromCjs } from './dep-df561101.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-3b8eb186.js';
5
+ import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-df561101.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -738,7 +738,7 @@ cli
738
738
  filterDuplicateOptions(options);
739
739
  // output structure is preserved even after bundling so require()
740
740
  // is ok here
741
- const { createServer } = await import('./chunks/dep-3b8eb186.js').then(function (n) { return n.I; });
741
+ const { createServer } = await import('./chunks/dep-df561101.js').then(function (n) { return n.I; });
742
742
  try {
743
743
  const server = await createServer({
744
744
  root,
@@ -816,7 +816,7 @@ cli
816
816
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
817
817
  .action(async (root, options) => {
818
818
  filterDuplicateOptions(options);
819
- const { build } = await import('./chunks/dep-3b8eb186.js').then(function (n) { return n.H; });
819
+ const { build } = await import('./chunks/dep-df561101.js').then(function (n) { return n.H; });
820
820
  const buildOptions = cleanOptions(options);
821
821
  try {
822
822
  await build({
@@ -844,7 +844,7 @@ cli
844
844
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
845
845
  .action(async (root, options) => {
846
846
  filterDuplicateOptions(options);
847
- const { optimizeDeps } = await import('./chunks/dep-3b8eb186.js').then(function (n) { return n.G; });
847
+ const { optimizeDeps } = await import('./chunks/dep-df561101.js').then(function (n) { return n.G; });
848
848
  try {
849
849
  const config = await resolveConfig({
850
850
  root,
@@ -871,7 +871,7 @@ cli
871
871
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
872
872
  .action(async (root, options) => {
873
873
  filterDuplicateOptions(options);
874
- const { preview } = await import('./chunks/dep-3b8eb186.js').then(function (n) { return n.J; });
874
+ const { preview } = await import('./chunks/dep-df561101.js').then(function (n) { return n.J; });
875
875
  try {
876
876
  const server = await preview({
877
877
  root,
@@ -2,36 +2,36 @@
2
2
 
3
3
  import type { Agent } from 'node:http';
4
4
  import type { BuildOptions as BuildOptions_2 } from 'esbuild';
5
- import { ChunkMetadata } from "../../types/metadata";
5
+ import { ChunkMetadata } from "../../types/metadata.js";
6
6
  import type { ClientRequest } from 'node:http';
7
7
  import type { ClientRequestArgs } from 'node:http';
8
- import { ConnectedPayload } from "../../types/hmrPayload";
9
- import { CustomEventMap } from "../../types/customEvent";
10
- import { CustomPayload } from "../../types/hmrPayload";
8
+ import { ConnectedPayload } from "../../types/hmrPayload.js";
9
+ import { CustomEventMap } from "../../types/customEvent.js";
10
+ import { CustomPayload } from "../../types/hmrPayload.js";
11
11
  import type { CustomPluginOptions } from 'rollup';
12
12
  import type { Duplex } from 'node:stream';
13
13
  import type { DuplexOptions } from 'node:stream';
14
- import { ErrorPayload } from "../../types/hmrPayload";
14
+ import { ErrorPayload } from "../../types/hmrPayload.js";
15
15
  import { TransformOptions as EsbuildTransformOptions } from 'esbuild';
16
16
  import { version as esbuildVersion } from 'esbuild';
17
17
  import { EventEmitter } from 'node:events';
18
18
  import * as events from 'node:events';
19
19
  import type { ExistingRawSourceMap } from 'rollup';
20
20
  import type * as fs from 'node:fs';
21
- import { FullReloadPayload } from "../../types/hmrPayload";
22
- import { GeneralImportGlobOptions } from "../../types/importGlob";
21
+ import { FullReloadPayload } from "../../types/hmrPayload.js";
22
+ import { GeneralImportGlobOptions } from "../../types/importGlob.js";
23
23
  import type { GetManualChunk } from 'rollup';
24
- import { HMRPayload } from "../../types/hmrPayload";
24
+ import { HMRPayload } from "../../types/hmrPayload.js";
25
25
  import * as http from 'node:http';
26
- import { ImportGlobEagerFunction } from "../../types/importGlob";
27
- import { ImportGlobFunction } from "../../types/importGlob";
28
- import { ImportGlobOptions } from "../../types/importGlob";
26
+ import { ImportGlobEagerFunction } from "../../types/importGlob.js";
27
+ import { ImportGlobFunction } from "../../types/importGlob.js";
28
+ import { ImportGlobOptions } from "../../types/importGlob.js";
29
29
  import type { IncomingMessage } from 'node:http';
30
- import { InferCustomEventPayload } from "../../types/customEvent";
30
+ import { InferCustomEventPayload } from "../../types/customEvent.js";
31
31
  import type { InputOption } from 'rollup';
32
32
  import type { InputOptions } from 'rollup';
33
- import { InvalidatePayload } from "../../types/customEvent";
34
- import { KnownAsTypeMap } from "../../types/importGlob";
33
+ import { InvalidatePayload } from "../../types/customEvent.js";
34
+ import { KnownAsTypeMap } from "../../types/importGlob.js";
35
35
  import type { LoadResult } from 'rollup';
36
36
 
37
37
  import type { ModuleFormat } from 'rollup';
@@ -46,7 +46,7 @@ import type { Plugin as Plugin_3 } from 'rollup';
46
46
  import type { PluginContext } from 'rollup';
47
47
  import type { PluginHooks } from 'rollup';
48
48
  import type * as PostCSS from 'postcss';
49
- import { PrunePayload } from "../../types/hmrPayload";
49
+ import { PrunePayload } from "../../types/hmrPayload.js";
50
50
  import type { ResolveIdResult } from 'rollup';
51
51
  import type * as Rollup from 'rollup';
52
52
  import type { RollupError } from 'rollup';
@@ -66,8 +66,8 @@ import type * as stream from 'node:stream';
66
66
  import type { TransformPluginContext } from 'rollup';
67
67
  import type { TransformResult as TransformResult_2 } from 'rollup';
68
68
  import type { TransformResult as TransformResult_3 } from 'esbuild';
69
- import { Update } from "../../types/hmrPayload";
70
- import { UpdatePayload } from "../../types/hmrPayload";
69
+ import { Update } from "../../types/hmrPayload.js";
70
+ import { UpdatePayload } from "../../types/hmrPayload.js";
71
71
  import type * as url from 'node:url';
72
72
  import type { URL as URL_2 } from 'node:url';
73
73
  import type { WatcherOptions } from 'rollup';
@@ -574,6 +574,8 @@ export declare function defineConfig(config: UserConfig): UserConfig;
574
574
 
575
575
  export declare function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>;
576
576
 
577
+ export declare function defineConfig(config: UserConfigFnObject): UserConfigFnObject;
578
+
577
579
  export declare function defineConfig(config: UserConfigExport): UserConfigExport;
578
580
 
579
581
  export declare interface DepOptimizationConfig {
@@ -1783,7 +1785,7 @@ export declare interface ResolvedBuildOptions extends Required<Omit<BuildOptions
1783
1785
  modulePreload: false | ResolvedModulePreloadOptions;
1784
1786
  }
1785
1787
 
1786
- export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'css' | 'assetsInclude' | 'optimizeDeps' | 'worker'> & {
1788
+ export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'css' | 'assetsInclude' | 'optimizeDeps' | 'worker' | 'build'> & {
1787
1789
  configFile: string | undefined;
1788
1790
  configFileDependencies: string[];
1789
1791
  inlineConfig: InlineConfig;
@@ -1,5 +1,5 @@
1
- import { i as isInNodeModules } from './chunks/dep-3b8eb186.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-3b8eb186.js';
1
+ import { i as isInNodeModules } from './chunks/dep-df561101.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-df561101.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';
@@ -3825,6 +3825,11 @@ function createLogger(level = 'info', options = {}) {
3825
3825
  if (options.customLogger) {
3826
3826
  return options.customLogger;
3827
3827
  }
3828
+ const timeFormatter = new Intl.DateTimeFormat(undefined, {
3829
+ hour: 'numeric',
3830
+ minute: 'numeric',
3831
+ second: 'numeric',
3832
+ });
3828
3833
  const loggedErrors = new WeakSet();
3829
3834
  const { prefix = '[vite]', allowClearScreen = true } = options;
3830
3835
  const thresh = LogLevels[level];
@@ -3840,7 +3845,7 @@ function createLogger(level = 'info', options = {}) {
3840
3845
  : type === 'warn'
3841
3846
  ? colors.yellow(colors.bold(prefix))
3842
3847
  : colors.red(colors.bold(prefix));
3843
- return `${colors.dim(new Date().toLocaleTimeString())} ${tag} ${msg}`;
3848
+ return `${colors.dim(timeFormatter.format(new Date()))} ${tag} ${msg}`;
3844
3849
  }
3845
3850
  else {
3846
3851
  return msg;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "4.4.7",
3
+ "version": "4.4.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -68,8 +68,8 @@
68
68
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
69
69
  "dependencies": {
70
70
  "esbuild": "^0.18.10",
71
- "postcss": "^8.4.26",
72
- "rollup": "^3.25.2"
71
+ "postcss": "^8.4.27",
72
+ "rollup": "^3.27.1"
73
73
  },
74
74
  "optionalDependencies": {
75
75
  "fsevents": "~2.3.2"
@@ -86,8 +86,8 @@
86
86
  "@rollup/plugin-node-resolve": "15.1.0",
87
87
  "@rollup/plugin-typescript": "^11.1.2",
88
88
  "@rollup/pluginutils": "^5.0.2",
89
- "@types/pnpapi": "^0.0.2",
90
89
  "@types/escape-html": "^1.0.2",
90
+ "@types/pnpapi": "^0.0.2",
91
91
  "acorn": "^8.10.0",
92
92
  "acorn-walk": "^8.2.0",
93
93
  "cac": "^6.7.14",
@@ -105,12 +105,12 @@
105
105
  "escape-html": "^1.0.3",
106
106
  "estree-walker": "^3.0.3",
107
107
  "etag": "^1.8.1",
108
- "fast-glob": "^3.3.0",
108
+ "fast-glob": "^3.3.1",
109
109
  "http-proxy": "^1.18.1",
110
110
  "json-stable-stringify": "^1.0.2",
111
111
  "launch-editor-middleware": "^2.6.0",
112
112
  "lightningcss": "^1.21.5",
113
- "magic-string": "^0.30.1",
113
+ "magic-string": "^0.30.2",
114
114
  "micromatch": "^4.0.5",
115
115
  "mlly": "^1.4.0",
116
116
  "mrmime": "^1.0.1",
@@ -128,20 +128,20 @@
128
128
  "sirv": "^2.0.3",
129
129
  "source-map-support": "^0.5.21",
130
130
  "strip-ansi": "^7.1.0",
131
- "strip-literal": "^1.0.1",
131
+ "strip-literal": "^1.3.0",
132
132
  "tsconfck": "^2.1.2",
133
- "tslib": "^2.6.0",
133
+ "tslib": "^2.6.1",
134
134
  "types": "link:./types",
135
- "ufo": "^1.1.2",
135
+ "ufo": "^1.2.0",
136
136
  "ws": "^8.13.0"
137
137
  },
138
138
  "peerDependencies": {
139
139
  "@types/node": ">= 14",
140
140
  "less": "*",
141
+ "lightningcss": "^1.21.0",
141
142
  "sass": "*",
142
143
  "stylus": "*",
143
144
  "sugarss": "*",
144
- "lightningcss": "^1.21.0",
145
145
  "terser": "^5.4.0"
146
146
  },
147
147
  "peerDependenciesMeta": {
@@ -2,8 +2,6 @@
2
2
  // Thus cannot contain any top-level imports
3
3
  // <https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation>
4
4
 
5
- /* eslint-disable @typescript-eslint/consistent-type-imports */
6
-
7
5
  interface ImportMetaEnv {
8
6
  [key: string]: any
9
7
  BASE_URL: string