vite 3.0.0 → 3.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.
package/dist/node/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { performance } from 'node:perf_hooks';
2
2
  import { EventEmitter } from 'events';
3
- import { y as picocolors, u as createLogger, e as resolveConfig } from './chunks/dep-561c5231.js';
3
+ import { y as picocolors, u as createLogger, e as resolveConfig } from './chunks/dep-c6273c7a.js';
4
4
  import { VERSION } from './constants.js';
5
5
  import 'node:fs';
6
6
  import 'node:path';
@@ -694,7 +694,7 @@ cli
694
694
  .action(async (root, options) => {
695
695
  // output structure is preserved even after bundling so require()
696
696
  // is ok here
697
- const { createServer } = await import('./chunks/dep-561c5231.js').then(function (n) { return n.E; });
697
+ const { createServer } = await import('./chunks/dep-c6273c7a.js').then(function (n) { return n.E; });
698
698
  try {
699
699
  const server = await createServer({
700
700
  root,
@@ -741,7 +741,7 @@ cli
741
741
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
742
742
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
743
743
  .action(async (root, options) => {
744
- const { build } = await import('./chunks/dep-561c5231.js').then(function (n) { return n.D; });
744
+ const { build } = await import('./chunks/dep-c6273c7a.js').then(function (n) { return n.D; });
745
745
  const buildOptions = cleanOptions(options);
746
746
  try {
747
747
  await build({
@@ -765,7 +765,7 @@ cli
765
765
  .command('optimize [root]', 'pre-bundle dependencies')
766
766
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
767
767
  .action(async (root, options) => {
768
- const { optimizeDeps } = await import('./chunks/dep-561c5231.js').then(function (n) { return n.C; });
768
+ const { optimizeDeps } = await import('./chunks/dep-c6273c7a.js').then(function (n) { return n.C; });
769
769
  try {
770
770
  const config = await resolveConfig({
771
771
  root,
@@ -788,7 +788,7 @@ cli
788
788
  .option('--https', `[boolean] use TLS + HTTP/2`)
789
789
  .option('--open [path]', `[boolean | string] open browser on startup`)
790
790
  .action(async (root, options) => {
791
- const { preview } = await import('./chunks/dep-561c5231.js').then(function (n) { return n.F; });
791
+ const { preview } = await import('./chunks/dep-c6273c7a.js').then(function (n) { return n.F; });
792
792
  try {
793
793
  const server = await preview({
794
794
  root,
@@ -1,7 +1,7 @@
1
1
  import path, { resolve } from 'node:path';
2
2
  import { fileURLToPath } from 'node:url';
3
3
 
4
- var version = "3.0.0";
4
+ var version = "3.0.3";
5
5
 
6
6
  const VERSION = version;
7
7
  const DEFAULT_MAIN_FIELDS = [
@@ -9,8 +9,9 @@ const DEFAULT_MAIN_FIELDS = [
9
9
  'jsnext:main',
10
10
  'jsnext'
11
11
  ];
12
- // Support browserslist
13
- // "defaults and supports es6-module and supports es6-module-dynamic-import",
12
+ // Baseline support browserslist
13
+ // "defaults and supports es6-module and supports es6-module-dynamic-import"
14
+ // Higher browser versions may be needed for extra features.
14
15
  const ESBUILD_MODULES_TARGET = [
15
16
  'es2020',
16
17
  'edge88',
@@ -21,6 +22,7 @@ const ESBUILD_MODULES_TARGET = [
21
22
  const DEFAULT_EXTENSIONS = [
22
23
  '.mjs',
23
24
  '.js',
25
+ '.mts',
24
26
  '.ts',
25
27
  '.jsx',
26
28
  '.tsx',
@@ -35,7 +37,7 @@ const DEFAULT_CONFIG_FILES = [
35
37
  'vite.config.cts'
36
38
  ];
37
39
  const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
38
- const OPTIMIZABLE_ENTRY_RE = /\.(?:(m|c)?js|ts)$/;
40
+ const OPTIMIZABLE_ENTRY_RE = /\.(?:[cm]?[jt]s)$/;
39
41
  const SPECIAL_QUERY_RE = /[\?&](?:worker|sharedworker|raw|url)\b/;
40
42
  /**
41
43
  * Prefix for resolved fs paths, since windows paths may not be valid as URLs.
@@ -543,7 +543,7 @@ export declare interface DepOptimizationConfig {
543
543
  * List of file extensions that can be optimized. A corresponding esbuild
544
544
  * plugin must exist to handle the specific extension.
545
545
  *
546
- * By default, Vite can optimize `.mjs`, `.js`, and `.ts` files. This option
546
+ * By default, Vite can optimize `.mjs`, `.js`, `.ts`, and `.mts` files. This option
547
547
  * allows specifying additional extensions.
548
548
  *
549
549
  * @experimental
@@ -552,8 +552,8 @@ export declare interface DepOptimizationConfig {
552
552
  /**
553
553
  * Disables dependencies optimizations, true disables the optimizer during
554
554
  * build and dev. Pass 'build' or 'dev' to only disable the optimizer in
555
- * one of the modes. Deps optimization is enabled by default in both
556
- * @default false
555
+ * one of the modes. Deps optimization is enabled by default in dev only.
556
+ * @default 'build'
557
557
  * @experimental
558
558
  */
559
559
  disabled?: boolean | 'build' | 'dev';
@@ -616,7 +616,7 @@ export declare interface DepOptimizationProcessing {
616
616
  export declare interface DepOptimizationResult {
617
617
  metadata: DepOptimizationMetadata;
618
618
  /**
619
- * When doing a re-run, if there are newly discovered dependendencies
619
+ * When doing a re-run, if there are newly discovered dependencies
620
620
  * the page reload will be delayed until the next rerun so we need
621
621
  * to be able to discard the result
622
622
  */
@@ -677,14 +677,14 @@ export { esbuildVersion }
677
677
 
678
678
  export declare interface ExperimentalOptions {
679
679
  /**
680
- * Append fake `&lang.(ext)` when queries are specified, to preseve the file extension for following plugins to process.
680
+ * Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
681
681
  *
682
682
  * @experimental
683
683
  * @default false
684
684
  */
685
685
  importGlobRestoreExtension?: boolean;
686
686
  /**
687
- * Allow finegrain contol over assets and public files paths
687
+ * Allow finegrain control over assets and public files paths
688
688
  *
689
689
  * @experimental
690
690
  */
@@ -1,4 +1,4 @@
1
- export { b as build, k as createFilter, u as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, h as getDepOptimizationConfig, i as isDepsOptimizerEnabled, l as loadConfigFromFile, w as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, x as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, v as searchForWorkspaceRoot, q as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-561c5231.js';
1
+ export { b as build, k as createFilter, u as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, h as getDepOptimizationConfig, i as isDepsOptimizerEnabled, l as loadConfigFromFile, w as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, x as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, v as searchForWorkspaceRoot, q as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-c6273c7a.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';
@@ -31,7 +31,7 @@ var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
31
31
  var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
32
32
  var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
33
33
 
34
- var version = "3.0.0";
34
+ var version = "3.0.3";
35
35
 
36
36
  const VERSION = version;
37
37
  const VITE_PACKAGE_DIR = path$3.resolve(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "3.0.0",
3
+ "version": "3.0.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -32,7 +32,7 @@
32
32
  "types"
33
33
  ],
34
34
  "engines": {
35
- "node": ">=14.18.0"
35
+ "node": "^14.18.0 || >=16.0.0"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -68,8 +68,8 @@
68
68
  },
69
69
  "devDependencies": {
70
70
  "@ampproject/remapping": "^2.2.0",
71
- "@babel/parser": "^7.18.8",
72
- "@babel/types": "^7.18.8",
71
+ "@babel/parser": "^7.18.9",
72
+ "@babel/types": "^7.18.9",
73
73
  "@jridgewell/trace-mapping": "^0.3.14",
74
74
  "@rollup/plugin-alias": "^3.1.9",
75
75
  "@rollup/plugin-commonjs": "^22.0.1",
@@ -119,7 +119,7 @@
119
119
  "tslib": "^2.4.0",
120
120
  "types": "link:./types",
121
121
  "ufo": "^0.8.5",
122
- "ws": "^8.8.0"
122
+ "ws": "^8.8.1"
123
123
  },
124
124
  "peerDependencies": {
125
125
  "less": "*",
@@ -115,6 +115,9 @@ code {
115
115
  const fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g
116
116
  const codeframeRE = /^(?:>?\s+\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm
117
117
 
118
+ // Allow `ErrorOverlay` to extend `HTMLElement` even in environments where
119
+ // `HTMLElement` was not originally defined.
120
+ const { HTMLElement = class {} as typeof globalThis.HTMLElement } = globalThis
118
121
  export class ErrorOverlay extends HTMLElement {
119
122
  root: ShadowRoot
120
123
 
@@ -184,6 +187,7 @@ export class ErrorOverlay extends HTMLElement {
184
187
  }
185
188
 
186
189
  export const overlayId = 'vite-error-overlay'
190
+ const { customElements } = globalThis // Ensure `customElements` is defined before the next line.
187
191
  if (customElements && !customElements.get(overlayId)) {
188
192
  customElements.define(overlayId, ErrorOverlay)
189
193
  }
@@ -3,6 +3,7 @@
3
3
  "include": ["./", "../../types"],
4
4
  "compilerOptions": {
5
5
  "types": [],
6
+ "target": "ES2019",
6
7
  "lib": ["ESNext", "DOM"],
7
8
  "declaration": false
8
9
  }