vite 6.0.0-beta.9 → 6.0.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.

package/index.cjs CHANGED
@@ -1,3 +1,6 @@
1
+ const description =
2
+ ' See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.'
3
+
1
4
  warnCjsUsage()
2
5
 
3
6
  // type utils
@@ -17,12 +20,43 @@ const asyncFunctions = [
17
20
  'formatPostcssSourceMap',
18
21
  'loadConfigFromFile',
19
22
  'preprocessCSS',
23
+ 'createBuilder',
20
24
  ]
21
25
  asyncFunctions.forEach((name) => {
22
26
  module.exports[name] = (...args) =>
23
27
  import('./dist/node/index.js').then((i) => i[name](...args))
24
28
  })
25
29
 
30
+ // variables and sync functions that cannot be used from cjs build
31
+ const disallowedVariables = [
32
+ // was not exposed in cjs from the beginning
33
+ 'parseAst',
34
+ 'parseAstAsync',
35
+ 'buildErrorMessage',
36
+ 'sortUserPlugins',
37
+ // Environment API related variables that are too big to include in the cjs build
38
+ 'DevEnvironment',
39
+ 'BuildEnvironment',
40
+ 'createIdResolver',
41
+ 'createRunnableDevEnvironment',
42
+ // can be redirected from ESM, but doesn't make sense as it's Environment API related
43
+ 'fetchModule',
44
+ 'moduleRunnerTransform',
45
+ // can be exposed, but doesn't make sense as it's Environment API related
46
+ 'createServerHotChannel',
47
+ 'createServerModuleRunner',
48
+ 'isRunnableDevEnvironment',
49
+ ]
50
+ disallowedVariables.forEach((name) => {
51
+ Object.defineProperty(module.exports, name, {
52
+ get() {
53
+ throw new Error(
54
+ `${name} is not available in the CJS build of Vite.` + description,
55
+ )
56
+ },
57
+ })
58
+ })
59
+
26
60
  function warnCjsUsage() {
27
61
  if (process.env.VITE_CJS_IGNORE_WARNING) return
28
62
  const logLevelIndex = process.argv.findIndex((arg) =>
@@ -39,9 +73,7 @@ function warnCjsUsage() {
39
73
  }
40
74
  const yellow = (str) => `\u001b[33m${str}\u001b[39m`
41
75
  console.warn(
42
- yellow(
43
- `The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.`,
44
- ),
76
+ yellow("The CJS build of Vite's Node API is deprecated." + description),
45
77
  )
46
78
  if (process.env.VITE_CJS_TRACE) {
47
79
  const e = {}
package/misc/false.js ADDED
@@ -0,0 +1 @@
1
+ export default false
package/misc/true.js ADDED
@@ -0,0 +1 @@
1
+ export default true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "6.0.0-beta.9",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -20,22 +20,14 @@
20
20
  "types": "./dist/node/index.d.ts",
21
21
  "exports": {
22
22
  ".": {
23
- "import": {
24
- "types": "./dist/node/index.d.ts",
25
- "default": "./dist/node/index.js"
26
- },
27
- "require": {
28
- "types": "./index.d.cts",
29
- "default": "./index.cjs"
30
- }
23
+ "module-sync": "./dist/node/index.js",
24
+ "import": "./dist/node/index.js",
25
+ "require": "./index.cjs"
31
26
  },
32
27
  "./client": {
33
28
  "types": "./client.d.ts"
34
29
  },
35
- "./module-runner": {
36
- "types": "./dist/node/module-runner.d.ts",
37
- "import": "./dist/node/module-runner.js"
38
- },
30
+ "./module-runner": "./dist/node/module-runner.js",
39
31
  "./dist/client/*": "./dist/client/*",
40
32
  "./types/*": {
41
33
  "types": "./types/*"
@@ -50,16 +42,23 @@
50
42
  ]
51
43
  }
52
44
  },
45
+ "imports": {
46
+ "#module-sync-enabled": {
47
+ "module-sync": "./misc/true.js",
48
+ "default": "./misc/false.js"
49
+ }
50
+ },
53
51
  "files": [
54
52
  "bin",
55
53
  "dist",
54
+ "misc/**/*.js",
56
55
  "client.d.ts",
57
56
  "index.cjs",
58
57
  "index.d.cts",
59
58
  "types"
60
59
  ],
61
60
  "engines": {
62
- "node": "^18.0.0 || >=20.0.0"
61
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
63
62
  },
64
63
  "repository": {
65
64
  "type": "git",
@@ -74,9 +73,12 @@
74
73
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
75
74
  "dependencies": {
76
75
  "esbuild": "^0.24.0",
77
- "postcss": "^8.4.47",
76
+ "postcss": "^8.4.49",
78
77
  "rollup": "^4.23.0"
79
78
  },
79
+ "optionalDependencies": {
80
+ "fsevents": "~2.3.3"
81
+ },
80
82
  "devDependencies": {
81
83
  "@ampproject/remapping": "^2.3.0",
82
84
  "@babel/parser": "^7.26.2",
@@ -92,15 +94,15 @@
92
94
  "@types/pnpapi": "^0.0.5",
93
95
  "artichokie": "^0.2.1",
94
96
  "cac": "^6.7.14",
95
- "chokidar": "^4.0.1",
97
+ "chokidar": "^3.6.0",
96
98
  "connect": "^3.7.0",
97
99
  "convert-source-map": "^2.0.0",
98
100
  "cors": "^2.8.5",
99
- "cross-spawn": "^7.0.3",
101
+ "cross-spawn": "^7.0.6",
100
102
  "debug": "^4.3.7",
101
103
  "dep-types": "link:./src/types",
102
104
  "dotenv": "^16.4.5",
103
- "dotenv-expand": "^11.0.6",
105
+ "dotenv-expand": "^12.0.1",
104
106
  "es-module-lexer": "^1.5.4",
105
107
  "escape-html": "^1.0.3",
106
108
  "estree-walker": "^3.0.3",
@@ -108,8 +110,8 @@
108
110
  "http-proxy": "^1.18.1",
109
111
  "launch-editor-middleware": "^2.9.1",
110
112
  "lightningcss": "^1.28.1",
111
- "magic-string": "^0.30.12",
112
- "mlly": "^1.7.2",
113
+ "magic-string": "^0.30.13",
114
+ "mlly": "^1.7.3",
113
115
  "mrmime": "^2.0.0",
114
116
  "nanoid": "^5.0.8",
115
117
  "open": "^10.1.0",
@@ -120,17 +122,16 @@
120
122
  "picomatch": "^4.0.2",
121
123
  "postcss-import": "^16.1.0",
122
124
  "postcss-load-config": "^6.0.1",
123
- "postcss-modules": "^6.0.0",
125
+ "postcss-modules": "^6.0.1",
124
126
  "resolve.exports": "^2.0.2",
125
127
  "rollup-plugin-dts": "^6.1.1",
126
128
  "rollup-plugin-esbuild": "^6.1.1",
127
129
  "rollup-plugin-license": "^3.5.3",
128
- "sass": "^1.80.6",
129
- "sass-embedded": "^1.80.6",
130
+ "sass": "^1.81.0",
131
+ "sass-embedded": "^1.81.0",
130
132
  "sirv": "^3.0.0",
131
133
  "source-map-support": "^0.5.21",
132
- "strip-ansi": "^7.1.0",
133
- "strip-literal": "^2.1.0",
134
+ "strip-literal": "^2.1.1",
134
135
  "tinyglobby": "^0.2.10",
135
136
  "tsconfck": "^3.1.4",
136
137
  "tslib": "^2.8.1",
@@ -139,7 +140,7 @@
139
140
  "ws": "^8.18.0"
140
141
  },
141
142
  "peerDependencies": {
142
- "@types/node": "^18.0.0 || >=20.0.0",
143
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
143
144
  "jiti": ">=1.21.0",
144
145
  "less": "*",
145
146
  "lightningcss": "^1.21.0",