vite 4.3.9 → 4.4.0-beta.0

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.

@@ -119,7 +119,7 @@ var colors = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
119
119
 
120
120
  var src = {exports: {}};
121
121
 
122
- var browser = {exports: {}};
122
+ var browser$1 = {exports: {}};
123
123
 
124
124
  /**
125
125
  * Helpers.
@@ -579,7 +579,7 @@ function requireCommon () {
579
579
  var hasRequiredBrowser;
580
580
 
581
581
  function requireBrowser () {
582
- if (hasRequiredBrowser) return browser.exports;
582
+ if (hasRequiredBrowser) return browser$1.exports;
583
583
  hasRequiredBrowser = 1;
584
584
  (function (module, exports) {
585
585
  /**
@@ -849,8 +849,8 @@ function requireBrowser () {
849
849
  return '[UnexpectedJSONParseError]: ' + error.message;
850
850
  }
851
851
  };
852
- } (browser, browser.exports));
853
- return browser.exports;
852
+ } (browser$1, browser$1.exports));
853
+ return browser$1.exports;
854
854
  }
855
855
 
856
856
  var node = {exports: {}};
@@ -3351,6 +3351,19 @@ function isParentDirectory(dir, file) {
3351
3351
  return (file.startsWith(dir) ||
3352
3352
  (isCaseInsensitiveFS && file.toLowerCase().startsWith(dir.toLowerCase())));
3353
3353
  }
3354
+ /**
3355
+ * Check if 2 file name are identical
3356
+ *
3357
+ * Warning: parameters are not validated, only works with normalized absolute paths
3358
+ *
3359
+ * @param file1 - normalized absolute path
3360
+ * @param file2 - normalized absolute path
3361
+ * @returns true if both files url are identical
3362
+ */
3363
+ function isSameFileUri(file1, file2) {
3364
+ return (file1 === file2 ||
3365
+ (isCaseInsensitiveFS && file1.toLowerCase() === file2.toLowerCase()));
3366
+ }
3354
3367
  const postfixRE = /[?#].*$/s;
3355
3368
  function cleanUrl(url) {
3356
3369
  return url.replace(postfixRE, '');
@@ -3438,6 +3451,9 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
3438
3451
  return merged;
3439
3452
  }
3440
3453
  function mergeConfig(defaults, overrides, isRoot = true) {
3454
+ if (typeof defaults === 'function' || typeof overrides === 'function') {
3455
+ throw new Error(`Cannot merge config in form of callback`);
3456
+ }
3441
3457
  return mergeConfigRecursively(defaults, overrides, isRoot ? '' : '.');
3442
3458
  }
3443
3459
  function mergeAlias(a, b) {
@@ -3561,6 +3577,8 @@ function splitVendorChunkPlugin() {
3561
3577
  }
3562
3578
  // else, leave the object form of manualChunks untouched, as
3563
3579
  // we can't safely replicate rollup handling.
3580
+ // eslint-disable-next-line no-console
3581
+ console.warn("(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.manualChunks`. Consider using the function form instead.");
3564
3582
  }
3565
3583
  else {
3566
3584
  output.manualChunks = viteManualChunks;
@@ -3604,7 +3622,7 @@ var etag_1 = etag;
3604
3622
  * @private
3605
3623
  */
3606
3624
 
3607
- var crypto = require$$0$2;
3625
+ var crypto$1 = require$$0$2;
3608
3626
  var Stats = fs$2.Stats;
3609
3627
 
3610
3628
  /**
@@ -3629,7 +3647,7 @@ function entitytag (entity) {
3629
3647
  }
3630
3648
 
3631
3649
  // compute hash of entity
3632
- var hash = crypto
3650
+ var hash = crypto$1
3633
3651
  .createHash('sha1')
3634
3652
  .update(entity, 'utf8')
3635
3653
  .digest('base64')
@@ -3942,7 +3960,7 @@ function isFileServingAllowed(url, server) {
3942
3960
  return false;
3943
3961
  if (server.moduleGraph.safeModulesPath.has(file))
3944
3962
  return true;
3945
- if (server.config.server.fs.allow.some((dir) => isParentDirectory(dir, file)))
3963
+ if (server.config.server.fs.allow.some((uri) => isSameFileUri(uri, file) || isParentDirectory(uri, file)))
3946
3964
  return true;
3947
3965
  return false;
3948
3966
  }
@@ -3950,14 +3968,14 @@ function isFileServingAllowed(url, server) {
3950
3968
  var main$1 = {exports: {}};
3951
3969
 
3952
3970
  var name = "dotenv";
3953
- var version$1 = "16.0.3";
3971
+ var version$1 = "16.3.1";
3954
3972
  var description = "Loads environment variables from .env file";
3955
3973
  var main = "lib/main.js";
3956
3974
  var types = "lib/main.d.ts";
3957
3975
  var exports$1 = {
3958
3976
  ".": {
3959
- require: "./lib/main.js",
3960
3977
  types: "./lib/main.d.ts",
3978
+ require: "./lib/main.js",
3961
3979
  "default": "./lib/main.js"
3962
3980
  },
3963
3981
  "./config": "./config.js",
@@ -3981,6 +3999,7 @@ var repository = {
3981
3999
  type: "git",
3982
4000
  url: "git://github.com/motdotla/dotenv.git"
3983
4001
  };
4002
+ var funding = "https://github.com/motdotla/dotenv?sponsor=1";
3984
4003
  var keywords = [
3985
4004
  "dotenv",
3986
4005
  "env",
@@ -3993,21 +4012,24 @@ var keywords = [
3993
4012
  var readmeFilename = "README.md";
3994
4013
  var license = "BSD-2-Clause";
3995
4014
  var devDependencies = {
3996
- "@types/node": "^17.0.9",
4015
+ "@definitelytyped/dtslint": "^0.0.133",
4016
+ "@types/node": "^18.11.3",
3997
4017
  decache: "^4.6.1",
3998
- dtslint: "^3.7.0",
3999
- sinon: "^12.0.1",
4000
- standard: "^16.0.4",
4018
+ sinon: "^14.0.1",
4019
+ standard: "^17.0.0",
4001
4020
  "standard-markdown": "^7.1.0",
4002
- "standard-version": "^9.3.2",
4003
- tap: "^15.1.6",
4021
+ "standard-version": "^9.5.0",
4022
+ tap: "^16.3.0",
4004
4023
  tar: "^6.1.11",
4005
- typescript: "^4.5.4"
4024
+ typescript: "^4.8.4"
4006
4025
  };
4007
4026
  var engines = {
4008
4027
  node: ">=12"
4009
4028
  };
4010
- var require$$3 = {
4029
+ var browser = {
4030
+ fs: false
4031
+ };
4032
+ var require$$4 = {
4011
4033
  name: name,
4012
4034
  version: version$1,
4013
4035
  description: description,
@@ -4016,23 +4038,26 @@ var require$$3 = {
4016
4038
  exports: exports$1,
4017
4039
  scripts: scripts,
4018
4040
  repository: repository,
4041
+ funding: funding,
4019
4042
  keywords: keywords,
4020
4043
  readmeFilename: readmeFilename,
4021
4044
  license: license,
4022
4045
  devDependencies: devDependencies,
4023
- engines: engines
4046
+ engines: engines,
4047
+ browser: browser
4024
4048
  };
4025
4049
 
4026
4050
  const fs = fs$2;
4027
4051
  const path = require$$0$1;
4028
4052
  const os = require$$2;
4029
- const packageJson = require$$3;
4053
+ const crypto = require$$0$2;
4054
+ const packageJson = require$$4;
4030
4055
 
4031
4056
  const version = packageJson.version;
4032
4057
 
4033
4058
  const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
4034
4059
 
4035
- // Parser src into an Object
4060
+ // Parse src into an Object
4036
4061
  function parse (src) {
4037
4062
  const obj = {};
4038
4063
 
@@ -4071,20 +4096,142 @@ function parse (src) {
4071
4096
  return obj
4072
4097
  }
4073
4098
 
4099
+ function _parseVault (options) {
4100
+ const vaultPath = _vaultPath(options);
4101
+
4102
+ // Parse .env.vault
4103
+ const result = DotenvModule.configDotenv({ path: vaultPath });
4104
+ if (!result.parsed) {
4105
+ throw new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)
4106
+ }
4107
+
4108
+ // handle scenario for comma separated keys - for use with key rotation
4109
+ // example: DOTENV_KEY="dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenv.org/vault/.env.vault?environment=prod"
4110
+ const keys = _dotenvKey(options).split(',');
4111
+ const length = keys.length;
4112
+
4113
+ let decrypted;
4114
+ for (let i = 0; i < length; i++) {
4115
+ try {
4116
+ // Get full key
4117
+ const key = keys[i].trim();
4118
+
4119
+ // Get instructions for decrypt
4120
+ const attrs = _instructions(result, key);
4121
+
4122
+ // Decrypt
4123
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
4124
+
4125
+ break
4126
+ } catch (error) {
4127
+ // last key
4128
+ if (i + 1 >= length) {
4129
+ throw error
4130
+ }
4131
+ // try next key
4132
+ }
4133
+ }
4134
+
4135
+ // Parse decrypted .env string
4136
+ return DotenvModule.parse(decrypted)
4137
+ }
4138
+
4074
4139
  function _log (message) {
4140
+ console.log(`[dotenv@${version}][INFO] ${message}`);
4141
+ }
4142
+
4143
+ function _warn (message) {
4144
+ console.log(`[dotenv@${version}][WARN] ${message}`);
4145
+ }
4146
+
4147
+ function _debug (message) {
4075
4148
  console.log(`[dotenv@${version}][DEBUG] ${message}`);
4076
4149
  }
4077
4150
 
4151
+ function _dotenvKey (options) {
4152
+ // prioritize developer directly setting options.DOTENV_KEY
4153
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
4154
+ return options.DOTENV_KEY
4155
+ }
4156
+
4157
+ // secondary infra already contains a DOTENV_KEY environment variable
4158
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
4159
+ return process.env.DOTENV_KEY
4160
+ }
4161
+
4162
+ // fallback to empty string
4163
+ return ''
4164
+ }
4165
+
4166
+ function _instructions (result, dotenvKey) {
4167
+ // Parse DOTENV_KEY. Format is a URI
4168
+ let uri;
4169
+ try {
4170
+ uri = new URL(dotenvKey);
4171
+ } catch (error) {
4172
+ if (error.code === 'ERR_INVALID_URL') {
4173
+ throw new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development')
4174
+ }
4175
+
4176
+ throw error
4177
+ }
4178
+
4179
+ // Get decrypt key
4180
+ const key = uri.password;
4181
+ if (!key) {
4182
+ throw new Error('INVALID_DOTENV_KEY: Missing key part')
4183
+ }
4184
+
4185
+ // Get environment
4186
+ const environment = uri.searchParams.get('environment');
4187
+ if (!environment) {
4188
+ throw new Error('INVALID_DOTENV_KEY: Missing environment part')
4189
+ }
4190
+
4191
+ // Get ciphertext payload
4192
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
4193
+ const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION
4194
+ if (!ciphertext) {
4195
+ throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)
4196
+ }
4197
+
4198
+ return { ciphertext, key }
4199
+ }
4200
+
4201
+ function _vaultPath (options) {
4202
+ let dotenvPath = path.resolve(process.cwd(), '.env');
4203
+
4204
+ if (options && options.path && options.path.length > 0) {
4205
+ dotenvPath = options.path;
4206
+ }
4207
+
4208
+ // Locate .env.vault
4209
+ return dotenvPath.endsWith('.vault') ? dotenvPath : `${dotenvPath}.vault`
4210
+ }
4211
+
4078
4212
  function _resolveHome (envPath) {
4079
4213
  return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath
4080
4214
  }
4081
4215
 
4082
- // Populates process.env from .env file
4083
- function config (options) {
4216
+ function _configVault (options) {
4217
+ _log('Loading env from encrypted .env.vault');
4218
+
4219
+ const parsed = DotenvModule._parseVault(options);
4220
+
4221
+ let processEnv = process.env;
4222
+ if (options && options.processEnv != null) {
4223
+ processEnv = options.processEnv;
4224
+ }
4225
+
4226
+ DotenvModule.populate(processEnv, parsed, options);
4227
+
4228
+ return { parsed }
4229
+ }
4230
+
4231
+ function configDotenv (options) {
4084
4232
  let dotenvPath = path.resolve(process.cwd(), '.env');
4085
4233
  let encoding = 'utf8';
4086
4234
  const debug = Boolean(options && options.debug);
4087
- const override = Boolean(options && options.override);
4088
4235
 
4089
4236
  if (options) {
4090
4237
  if (options.path != null) {
@@ -4099,41 +4246,120 @@ function config (options) {
4099
4246
  // Specifying an encoding returns a string instead of a buffer
4100
4247
  const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }));
4101
4248
 
4102
- Object.keys(parsed).forEach(function (key) {
4103
- if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
4104
- process.env[key] = parsed[key];
4105
- } else {
4106
- if (override === true) {
4107
- process.env[key] = parsed[key];
4108
- }
4249
+ let processEnv = process.env;
4250
+ if (options && options.processEnv != null) {
4251
+ processEnv = options.processEnv;
4252
+ }
4109
4253
 
4110
- if (debug) {
4111
- if (override === true) {
4112
- _log(`"${key}" is already defined in \`process.env\` and WAS overwritten`);
4113
- } else {
4114
- _log(`"${key}" is already defined in \`process.env\` and was NOT overwritten`);
4115
- }
4116
- }
4117
- }
4118
- });
4254
+ DotenvModule.populate(processEnv, parsed, options);
4119
4255
 
4120
4256
  return { parsed }
4121
4257
  } catch (e) {
4122
4258
  if (debug) {
4123
- _log(`Failed to load ${dotenvPath} ${e.message}`);
4259
+ _debug(`Failed to load ${dotenvPath} ${e.message}`);
4124
4260
  }
4125
4261
 
4126
4262
  return { error: e }
4127
4263
  }
4128
4264
  }
4129
4265
 
4266
+ // Populates process.env from .env file
4267
+ function config (options) {
4268
+ const vaultPath = _vaultPath(options);
4269
+
4270
+ // fallback to original dotenv if DOTENV_KEY is not set
4271
+ if (_dotenvKey(options).length === 0) {
4272
+ return DotenvModule.configDotenv(options)
4273
+ }
4274
+
4275
+ // dotenvKey exists but .env.vault file does not exist
4276
+ if (!fs.existsSync(vaultPath)) {
4277
+ _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
4278
+
4279
+ return DotenvModule.configDotenv(options)
4280
+ }
4281
+
4282
+ return DotenvModule._configVault(options)
4283
+ }
4284
+
4285
+ function decrypt (encrypted, keyStr) {
4286
+ const key = Buffer.from(keyStr.slice(-64), 'hex');
4287
+ let ciphertext = Buffer.from(encrypted, 'base64');
4288
+
4289
+ const nonce = ciphertext.slice(0, 12);
4290
+ const authTag = ciphertext.slice(-16);
4291
+ ciphertext = ciphertext.slice(12, -16);
4292
+
4293
+ try {
4294
+ const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce);
4295
+ aesgcm.setAuthTag(authTag);
4296
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`
4297
+ } catch (error) {
4298
+ const isRange = error instanceof RangeError;
4299
+ const invalidKeyLength = error.message === 'Invalid key length';
4300
+ const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data';
4301
+
4302
+ if (isRange || invalidKeyLength) {
4303
+ const msg = 'INVALID_DOTENV_KEY: It must be 64 characters long (or more)';
4304
+ throw new Error(msg)
4305
+ } else if (decryptionFailed) {
4306
+ const msg = 'DECRYPTION_FAILED: Please check your DOTENV_KEY';
4307
+ throw new Error(msg)
4308
+ } else {
4309
+ console.error('Error: ', error.code);
4310
+ console.error('Error: ', error.message);
4311
+ throw error
4312
+ }
4313
+ }
4314
+ }
4315
+
4316
+ // Populate process.env with parsed values
4317
+ function populate (processEnv, parsed, options = {}) {
4318
+ const debug = Boolean(options && options.debug);
4319
+ const override = Boolean(options && options.override);
4320
+
4321
+ if (typeof parsed !== 'object') {
4322
+ throw new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')
4323
+ }
4324
+
4325
+ // Set process.env
4326
+ for (const key of Object.keys(parsed)) {
4327
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
4328
+ if (override === true) {
4329
+ processEnv[key] = parsed[key];
4330
+ }
4331
+
4332
+ if (debug) {
4333
+ if (override === true) {
4334
+ _debug(`"${key}" is already defined and WAS overwritten`);
4335
+ } else {
4336
+ _debug(`"${key}" is already defined and was NOT overwritten`);
4337
+ }
4338
+ }
4339
+ } else {
4340
+ processEnv[key] = parsed[key];
4341
+ }
4342
+ }
4343
+ }
4344
+
4130
4345
  const DotenvModule = {
4346
+ configDotenv,
4347
+ _configVault,
4348
+ _parseVault,
4131
4349
  config,
4132
- parse
4350
+ decrypt,
4351
+ parse,
4352
+ populate
4133
4353
  };
4134
4354
 
4355
+ main$1.exports.configDotenv = DotenvModule.configDotenv;
4356
+ main$1.exports._configVault = DotenvModule._configVault;
4357
+ main$1.exports._parseVault = DotenvModule._parseVault;
4135
4358
  main$1.exports.config = DotenvModule.config;
4359
+ main$1.exports.decrypt = DotenvModule.decrypt;
4136
4360
  var parse_1 = main$1.exports.parse = DotenvModule.parse;
4361
+ main$1.exports.populate = DotenvModule.populate;
4362
+
4137
4363
  main$1.exports = DotenvModule;
4138
4364
 
4139
4365
  function _interpolate (envValue, environment, config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "4.3.9",
3
+ "version": "4.4.0-beta.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -56,7 +56,7 @@
56
56
  "build-types": "run-s build-types-temp build-types-pre-patch build-types-roll build-types-post-patch build-types-check",
57
57
  "build-types-temp": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
58
58
  "build-types-pre-patch": "tsx scripts/prePatchTypes.ts",
59
- "build-types-roll": "api-extractor run && rimraf temp",
59
+ "build-types-roll": "tsx scripts/api-extractor.ts run && rimraf temp",
60
60
  "build-types-post-patch": "tsx scripts/postPatchTypes.ts",
61
61
  "build-types-check": "tsx scripts/checkBuiltTypes.ts && tsc --project tsconfig.check.json",
62
62
  "typecheck": "tsc --noEmit",
@@ -66,8 +66,8 @@
66
66
  },
67
67
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
68
68
  "dependencies": {
69
- "esbuild": "^0.17.5",
70
- "postcss": "^8.4.23",
69
+ "esbuild": "^0.18.2",
70
+ "postcss": "^8.4.24",
71
71
  "rollup": "^3.21.0"
72
72
  },
73
73
  "optionalDependencies": {
@@ -75,19 +75,19 @@
75
75
  },
76
76
  "devDependencies": {
77
77
  "@ampproject/remapping": "^2.2.1",
78
- "@babel/parser": "^7.21.4",
79
- "@babel/types": "^7.21.4",
78
+ "@babel/parser": "^7.22.5",
79
+ "@babel/types": "^7.22.5",
80
80
  "@jridgewell/trace-mapping": "^0.3.18",
81
81
  "@rollup/plugin-alias": "^4.0.4",
82
- "@rollup/plugin-commonjs": "^24.1.0",
82
+ "@rollup/plugin-commonjs": "^25.0.1",
83
83
  "@rollup/plugin-dynamic-import-vars": "^2.0.3",
84
84
  "@rollup/plugin-json": "^6.0.0",
85
- "@rollup/plugin-node-resolve": "15.0.2",
86
- "@rollup/plugin-typescript": "^11.1.0",
85
+ "@rollup/plugin-node-resolve": "15.1.0",
86
+ "@rollup/plugin-typescript": "^11.1.1",
87
87
  "@rollup/pluginutils": "^5.0.2",
88
88
  "@types/pnpapi": "^0.0.2",
89
89
  "@types/escape-html": "^1.0.2",
90
- "acorn": "^8.8.2",
90
+ "acorn": "^8.9.0",
91
91
  "acorn-walk": "^8.2.0",
92
92
  "cac": "^6.7.14",
93
93
  "chokidar": "^3.5.3",
@@ -98,9 +98,9 @@
98
98
  "cross-spawn": "^7.0.3",
99
99
  "debug": "^4.3.4",
100
100
  "dep-types": "link:./src/types",
101
- "dotenv": "^16.0.3",
101
+ "dotenv": "^16.3.1",
102
102
  "dotenv-expand": "^9.0.0",
103
- "es-module-lexer": "^1.2.1",
103
+ "es-module-lexer": "^1.3.0",
104
104
  "escape-html": "^1.0.3",
105
105
  "estree-walker": "^3.0.3",
106
106
  "etag": "^1.8.1",
@@ -108,9 +108,10 @@
108
108
  "http-proxy": "^1.18.1",
109
109
  "json-stable-stringify": "^1.0.2",
110
110
  "launch-editor-middleware": "^2.6.0",
111
+ "lightningcss": "^1.21.0",
111
112
  "magic-string": "^0.30.0",
112
113
  "micromatch": "^4.0.5",
113
- "mlly": "^1.2.0",
114
+ "mlly": "^1.3.0",
114
115
  "mrmime": "^1.0.1",
115
116
  "okie": "^1.0.1",
116
117
  "open": "^8.4.2",
@@ -123,14 +124,14 @@
123
124
  "postcss-modules": "^6.0.0",
124
125
  "resolve.exports": "^2.0.2",
125
126
  "rollup-plugin-license": "^3.0.1",
126
- "sirv": "^2.0.2",
127
+ "sirv": "^2.0.3",
127
128
  "source-map-support": "^0.5.21",
128
- "strip-ansi": "^7.0.1",
129
+ "strip-ansi": "^7.1.0",
129
130
  "strip-literal": "^1.0.1",
130
131
  "tsconfck": "^2.1.1",
131
- "tslib": "^2.5.0",
132
+ "tslib": "^2.5.3",
132
133
  "types": "link:./types",
133
- "ufo": "^1.1.1",
134
+ "ufo": "^1.1.2",
134
135
  "ws": "^8.13.0"
135
136
  },
136
137
  "peerDependencies": {
@@ -139,6 +140,7 @@
139
140
  "sass": "*",
140
141
  "stylus": "*",
141
142
  "sugarss": "*",
143
+ "lightningcss": "^1.21.0",
142
144
  "terser": "^5.4.0"
143
145
  },
144
146
  "peerDependenciesMeta": {
@@ -157,6 +159,9 @@
157
159
  "sugarss": {
158
160
  "optional": true
159
161
  },
162
+ "lightningcss": {
163
+ "optional": true
164
+ },
160
165
  "terser": {
161
166
  "optional": true
162
167
  }
@@ -12,6 +12,18 @@ export interface CustomEventMap {
12
12
  'vite:beforeFullReload': FullReloadPayload
13
13
  'vite:error': ErrorPayload
14
14
  'vite:invalidate': InvalidatePayload
15
+ 'vite:ws:connect': WebSocketConnectionPayload
16
+ 'vite:ws:disconnect': WebSocketConnectionPayload
17
+ }
18
+
19
+ export interface WebSocketConnectionPayload {
20
+ /**
21
+ * @experimental
22
+ * We expose this instance experimentally to see potential usage.
23
+ * This might be removed in the future if we didn't find reasonable use cases.
24
+ * If you find this useful, please open an issue with details so we can discuss and make it stable API.
25
+ */
26
+ webSocket: WebSocket
15
27
  }
16
28
 
17
29
  export interface InvalidatePayload {