vite 5.4.0-beta.1 → 5.4.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 { B as getDefaultExportFromCjs } from './dep-gy9yrVx2.js';
1
+ import { B as getDefaultExportFromCjs } from './dep-Cy9twKMn.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-IQS-Za7F.js';
package/dist/node/cli.js CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import fs__default from 'node:fs';
3
3
  import { performance } from 'node:perf_hooks';
4
4
  import { EventEmitter } from 'events';
5
- import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-gy9yrVx2.js';
5
+ import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-Cy9twKMn.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -730,7 +730,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
730
730
  `[boolean] force the optimizer to ignore the cache and re-bundle`
731
731
  ).action(async (root, options) => {
732
732
  filterDuplicateOptions(options);
733
- const { createServer } = await import('./chunks/dep-gy9yrVx2.js').then(function (n) { return n.E; });
733
+ const { createServer } = await import('./chunks/dep-Cy9twKMn.js').then(function (n) { return n.E; });
734
734
  try {
735
735
  const server = await createServer({
736
736
  root,
@@ -822,7 +822,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
822
822
  `[boolean] force empty outDir when it's outside of root`
823
823
  ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).action(async (root, options) => {
824
824
  filterDuplicateOptions(options);
825
- const { build } = await import('./chunks/dep-gy9yrVx2.js').then(function (n) { return n.F; });
825
+ const { build } = await import('./chunks/dep-Cy9twKMn.js').then(function (n) { return n.F; });
826
826
  const buildOptions = cleanOptions(options);
827
827
  try {
828
828
  await build({
@@ -851,7 +851,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
851
851
  ).action(
852
852
  async (root, options) => {
853
853
  filterDuplicateOptions(options);
854
- const { optimizeDeps } = await import('./chunks/dep-gy9yrVx2.js').then(function (n) { return n.D; });
854
+ const { optimizeDeps } = await import('./chunks/dep-Cy9twKMn.js').then(function (n) { return n.D; });
855
855
  try {
856
856
  const config = await resolveConfig(
857
857
  {
@@ -877,7 +877,7 @@ ${e.stack}`),
877
877
  cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(
878
878
  async (root, options) => {
879
879
  filterDuplicateOptions(options);
880
- const { preview } = await import('./chunks/dep-gy9yrVx2.js').then(function (n) { return n.G; });
880
+ const { preview } = await import('./chunks/dep-Cy9twKMn.js').then(function (n) { return n.G; });
881
881
  try {
882
882
  const server = await preview({
883
883
  root,
@@ -717,7 +717,7 @@ interface CommonServerOptions {
717
717
  * https://github.com/expressjs/cors#configuration-options
718
718
  */
719
719
  interface CorsOptions {
720
- origin?: CorsOrigin | ((origin: string, cb: (err: Error, origins: CorsOrigin) => void) => void);
720
+ origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
721
721
  methods?: string | string[];
722
722
  allowedHeaders?: string | string[];
723
723
  exposedHeaders?: string | string[];
@@ -936,6 +936,7 @@ declare class PluginContainer {
936
936
 
937
937
  declare const WebSocketAlias: typeof WebSocket
938
938
  interface WebSocketAlias extends WebSocket {}
939
+
939
940
  // WebSocket socket.
940
941
  declare class WebSocket extends EventEmitter {
941
942
  /** The connection is not yet open. */
@@ -1204,7 +1205,6 @@ declare class WebSocket extends EventEmitter {
1204
1205
  listener: (...args: any[]) => void,
1205
1206
  ): this
1206
1207
  }
1207
- // tslint:disable-line no-empty-interface
1208
1208
 
1209
1209
  declare namespace WebSocket {
1210
1210
  /**
@@ -1454,9 +1454,9 @@ declare namespace WebSocket {
1454
1454
  }
1455
1455
 
1456
1456
  const WebSocketServer: typeof Server
1457
- interface WebSocketServer extends Server {} // tslint:disable-line no-empty-interface
1457
+ interface WebSocketServer extends Server {}
1458
1458
  const WebSocket: typeof WebSocketAlias
1459
- interface WebSocket extends WebSocketAlias {} // tslint:disable-line no-empty-interface
1459
+ interface WebSocket extends WebSocketAlias {}
1460
1460
 
1461
1461
  // WebSocket stream
1462
1462
  function createWebSocketStream(
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-gy9yrVx2.js';
3
- export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-gy9yrVx2.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-Cy9twKMn.js';
3
+ export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-Cy9twKMn.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import { existsSync, readFileSync } from 'node:fs';
@@ -94,38 +94,46 @@ for (let i = 0; i < chars.length; i++) {
94
94
  const c = chars.charCodeAt(i);
95
95
  intToChar[i] = c, charToInt[c] = i;
96
96
  }
97
- function decode(mappings) {
98
- const state = new Int32Array(5), decoded = [];
99
- let index = 0;
100
- do {
101
- const semi = indexOf(mappings, index), line = [];
102
- let sorted = !0, lastCol = 0;
103
- state[0] = 0;
104
- for (let i = index; i < semi; i++) {
105
- let seg;
106
- i = decodeInteger(mappings, i, state, 0);
107
- const col = state[0];
108
- col < lastCol && (sorted = !1), lastCol = col, hasMoreVlq(mappings, i, semi) ? (i = decodeInteger(mappings, i, state, 1), i = decodeInteger(mappings, i, state, 2), i = decodeInteger(mappings, i, state, 3), hasMoreVlq(mappings, i, semi) ? (i = decodeInteger(mappings, i, state, 4), seg = [col, state[1], state[2], state[3], state[4]]) : seg = [col, state[1], state[2], state[3]]) : seg = [col], line.push(seg);
109
- }
110
- sorted || sort(line), decoded.push(line), index = semi + 1;
111
- } while (index <= mappings.length);
112
- return decoded;
113
- }
114
- function indexOf(mappings, index) {
115
- const idx = mappings.indexOf(";", index);
116
- return idx === -1 ? mappings.length : idx;
117
- }
118
- function decodeInteger(mappings, pos, state, j) {
97
+ function decodeInteger(reader, relative) {
119
98
  let value = 0, shift = 0, integer = 0;
120
99
  do {
121
- const c = mappings.charCodeAt(pos++);
100
+ const c = reader.next();
122
101
  integer = charToInt[c], value |= (integer & 31) << shift, shift += 5;
123
102
  } while (integer & 32);
124
103
  const shouldNegate = value & 1;
125
- return value >>>= 1, shouldNegate && (value = -2147483648 | -value), state[j] += value, pos;
104
+ return value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;
105
+ }
106
+ function hasMoreVlq(reader, max) {
107
+ return reader.pos >= max ? !1 : reader.peek() !== comma;
108
+ }
109
+ class StringReader {
110
+ constructor(buffer) {
111
+ this.pos = 0, this.buffer = buffer;
112
+ }
113
+ next() {
114
+ return this.buffer.charCodeAt(this.pos++);
115
+ }
116
+ peek() {
117
+ return this.buffer.charCodeAt(this.pos);
118
+ }
119
+ indexOf(char) {
120
+ const { buffer, pos } = this, idx = buffer.indexOf(char, pos);
121
+ return idx === -1 ? buffer.length : idx;
122
+ }
126
123
  }
127
- function hasMoreVlq(mappings, i, length) {
128
- return i >= length ? !1 : mappings.charCodeAt(i) !== comma;
124
+ function decode(mappings) {
125
+ const { length } = mappings, reader = new StringReader(mappings), decoded = [];
126
+ let genColumn = 0, sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;
127
+ do {
128
+ const semi = reader.indexOf(";"), line = [];
129
+ let sorted = !0, lastCol = 0;
130
+ for (genColumn = 0; reader.pos < semi; ) {
131
+ let seg;
132
+ genColumn = decodeInteger(reader, genColumn), genColumn < lastCol && (sorted = !1), lastCol = genColumn, hasMoreVlq(reader, semi) ? (sourcesIndex = decodeInteger(reader, sourcesIndex), sourceLine = decodeInteger(reader, sourceLine), sourceColumn = decodeInteger(reader, sourceColumn), hasMoreVlq(reader, semi) ? (namesIndex = decodeInteger(reader, namesIndex), seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]) : seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]) : seg = [genColumn], line.push(seg), reader.pos++;
133
+ }
134
+ sorted || sort(line), decoded.push(line), reader.pos = semi + 1;
135
+ } while (reader.pos <= length);
136
+ return decoded;
129
137
  }
130
138
  function sort(line) {
131
139
  line.sort(sortComparator);
@@ -28,13 +28,97 @@ const CLIENT_ENTRY = path$3.resolve(VITE_PACKAGE_DIR, "dist/client/client.mjs");
28
28
  path$3.resolve(VITE_PACKAGE_DIR, "dist/client/env.mjs");
29
29
  path$3.dirname(CLIENT_ENTRY);
30
30
 
31
- const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
32
- const intToChar$1 = new Uint8Array(64); // 64 possible chars.
33
- const charToInt$1 = new Uint8Array(128); // z is 122 in ASCII
34
- for (let i = 0; i < chars$1.length; i++) {
35
- const c = chars$1.charCodeAt(i);
36
- intToChar$1[i] = c;
37
- charToInt$1[c] = i;
31
+ const comma = ','.charCodeAt(0);
32
+ const semicolon = ';'.charCodeAt(0);
33
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
34
+ const intToChar = new Uint8Array(64); // 64 possible chars.
35
+ const charToInt = new Uint8Array(128); // z is 122 in ASCII
36
+ for (let i = 0; i < chars.length; i++) {
37
+ const c = chars.charCodeAt(i);
38
+ intToChar[i] = c;
39
+ charToInt[c] = i;
40
+ }
41
+ function encodeInteger(builder, num, relative) {
42
+ let delta = num - relative;
43
+ delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;
44
+ do {
45
+ let clamped = delta & 0b011111;
46
+ delta >>>= 5;
47
+ if (delta > 0)
48
+ clamped |= 0b100000;
49
+ builder.write(intToChar[clamped]);
50
+ } while (delta > 0);
51
+ return num;
52
+ }
53
+
54
+ const bufLength = 1024 * 16;
55
+ // Provide a fallback for older environments.
56
+ const td = typeof TextDecoder !== 'undefined'
57
+ ? /* #__PURE__ */ new TextDecoder()
58
+ : typeof Buffer !== 'undefined'
59
+ ? {
60
+ decode(buf) {
61
+ const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
62
+ return out.toString();
63
+ },
64
+ }
65
+ : {
66
+ decode(buf) {
67
+ let out = '';
68
+ for (let i = 0; i < buf.length; i++) {
69
+ out += String.fromCharCode(buf[i]);
70
+ }
71
+ return out;
72
+ },
73
+ };
74
+ class StringWriter {
75
+ constructor() {
76
+ this.pos = 0;
77
+ this.out = '';
78
+ this.buffer = new Uint8Array(bufLength);
79
+ }
80
+ write(v) {
81
+ const { buffer } = this;
82
+ buffer[this.pos++] = v;
83
+ if (this.pos === bufLength) {
84
+ this.out += td.decode(buffer);
85
+ this.pos = 0;
86
+ }
87
+ }
88
+ flush() {
89
+ const { buffer, out, pos } = this;
90
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
91
+ }
92
+ }
93
+ function encode(decoded) {
94
+ const writer = new StringWriter();
95
+ let sourcesIndex = 0;
96
+ let sourceLine = 0;
97
+ let sourceColumn = 0;
98
+ let namesIndex = 0;
99
+ for (let i = 0; i < decoded.length; i++) {
100
+ const line = decoded[i];
101
+ if (i > 0)
102
+ writer.write(semicolon);
103
+ if (line.length === 0)
104
+ continue;
105
+ let genColumn = 0;
106
+ for (let j = 0; j < line.length; j++) {
107
+ const segment = line[j];
108
+ if (j > 0)
109
+ writer.write(comma);
110
+ genColumn = encodeInteger(writer, segment[0], genColumn);
111
+ if (segment.length === 1)
112
+ continue;
113
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
114
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
115
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
116
+ if (segment.length === 4)
117
+ continue;
118
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
119
+ }
120
+ }
121
+ return writer.flush();
38
122
  }
39
123
 
40
124
  function getDefaultExportFromCjs (x) {
@@ -3964,99 +4048,6 @@ function stattag (stat) {
3964
4048
 
3965
4049
  var getEtag = /*@__PURE__*/getDefaultExportFromCjs(etag_1);
3966
4050
 
3967
- const comma = ','.charCodeAt(0);
3968
- const semicolon = ';'.charCodeAt(0);
3969
- const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
3970
- const intToChar = new Uint8Array(64); // 64 possible chars.
3971
- const charToInt = new Uint8Array(128); // z is 122 in ASCII
3972
- for (let i = 0; i < chars.length; i++) {
3973
- const c = chars.charCodeAt(i);
3974
- intToChar[i] = c;
3975
- charToInt[c] = i;
3976
- }
3977
- function encodeInteger(builder, num, relative) {
3978
- let delta = num - relative;
3979
- delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;
3980
- do {
3981
- let clamped = delta & 0b011111;
3982
- delta >>>= 5;
3983
- if (delta > 0)
3984
- clamped |= 0b100000;
3985
- builder.write(intToChar[clamped]);
3986
- } while (delta > 0);
3987
- return num;
3988
- }
3989
-
3990
- const bufLength = 1024 * 16;
3991
- // Provide a fallback for older environments.
3992
- const td = typeof TextDecoder !== 'undefined'
3993
- ? /* #__PURE__ */ new TextDecoder()
3994
- : typeof Buffer !== 'undefined'
3995
- ? {
3996
- decode(buf) {
3997
- const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
3998
- return out.toString();
3999
- },
4000
- }
4001
- : {
4002
- decode(buf) {
4003
- let out = '';
4004
- for (let i = 0; i < buf.length; i++) {
4005
- out += String.fromCharCode(buf[i]);
4006
- }
4007
- return out;
4008
- },
4009
- };
4010
- class StringWriter {
4011
- constructor() {
4012
- this.pos = 0;
4013
- this.out = '';
4014
- this.buffer = new Uint8Array(bufLength);
4015
- }
4016
- write(v) {
4017
- const { buffer } = this;
4018
- buffer[this.pos++] = v;
4019
- if (this.pos === bufLength) {
4020
- this.out += td.decode(buffer);
4021
- this.pos = 0;
4022
- }
4023
- }
4024
- flush() {
4025
- const { buffer, out, pos } = this;
4026
- return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
4027
- }
4028
- }
4029
- function encode(decoded) {
4030
- const writer = new StringWriter();
4031
- let sourcesIndex = 0;
4032
- let sourceLine = 0;
4033
- let sourceColumn = 0;
4034
- let namesIndex = 0;
4035
- for (let i = 0; i < decoded.length; i++) {
4036
- const line = decoded[i];
4037
- if (i > 0)
4038
- writer.write(semicolon);
4039
- if (line.length === 0)
4040
- continue;
4041
- let genColumn = 0;
4042
- for (let j = 0; j < line.length; j++) {
4043
- const segment = line[j];
4044
- if (j > 0)
4045
- writer.write(comma);
4046
- genColumn = encodeInteger(writer, segment[0], genColumn);
4047
- if (segment.length === 1)
4048
- continue;
4049
- sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
4050
- sourceLine = encodeInteger(writer, segment[2], sourceLine);
4051
- sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
4052
- if (segment.length === 4)
4053
- continue;
4054
- namesIndex = encodeInteger(writer, segment[4], namesIndex);
4055
- }
4056
- }
4057
- return writer.flush();
4058
- }
4059
-
4060
4051
  class BitSet {
4061
4052
  constructor(arg) {
4062
4053
  this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "5.4.0-beta.1",
3
+ "version": "5.4.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -73,7 +73,7 @@
73
73
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
74
74
  "dependencies": {
75
75
  "esbuild": "^0.21.3",
76
- "postcss": "^8.4.40",
76
+ "postcss": "^8.4.41",
77
77
  "rollup": "^4.13.0"
78
78
  },
79
79
  "optionalDependencies": {
@@ -81,7 +81,7 @@
81
81
  },
82
82
  "devDependencies": {
83
83
  "@ampproject/remapping": "^2.3.0",
84
- "@babel/parser": "^7.25.0",
84
+ "@babel/parser": "^7.25.3",
85
85
  "@jridgewell/trace-mapping": "^0.3.25",
86
86
  "@polka/compression": "^1.0.0-next.25",
87
87
  "@rollup/plugin-alias": "^5.1.0",
@@ -109,8 +109,8 @@
109
109
  "etag": "^1.8.1",
110
110
  "fast-glob": "^3.3.2",
111
111
  "http-proxy": "^1.18.1",
112
- "launch-editor-middleware": "^2.8.0",
113
- "lightningcss": "^1.25.1",
112
+ "launch-editor-middleware": "^2.8.1",
113
+ "lightningcss": "^1.26.0",
114
114
  "magic-string": "^0.30.11",
115
115
  "micromatch": "^4.0.7",
116
116
  "mlly": "^1.7.1",