vite 6.3.4 → 7.0.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.
- package/LICENSE.md +29 -0
- package/dist/client/client.mjs +796 -924
- package/dist/client/env.mjs +14 -19
- package/dist/node/chunks/dep-3jlWaCfC.js +5 -0
- package/dist/node/chunks/dep-B4i1tHPo.js +30 -0
- package/dist/node/chunks/dep-CCzsqxOh.js +5597 -0
- package/dist/node/chunks/dep-Ccq9jQdz.js +5 -0
- package/dist/node/chunks/dep-Ctugieod.js +150 -0
- package/dist/node/chunks/dep-D5HXLrlI.js +378 -0
- package/dist/node/chunks/dep-D_UgUiRQ.js +5 -0
- package/dist/node/chunks/dep-FHYvcJhE.js +446 -0
- package/dist/node/chunks/dep-P8c3Tybu.js +5 -0
- package/dist/node/chunks/dep-RiwDEHuV.js +7345 -0
- package/dist/node/chunks/dep-bvBD1i2C.js +36517 -0
- package/dist/node/cli.js +617 -865
- package/dist/node/constants.js +3 -148
- package/dist/node/index.d.ts +2730 -3081
- package/dist/node/index.js +25 -188
- package/dist/node/module-runner.d.ts +241 -229
- package/dist/node/module-runner.js +1041 -1175
- package/dist/node/moduleRunnerTransport-CnL9s_k9.d.ts +88 -0
- package/package.json +36 -38
- package/types/internal/cssPreprocessorOptions.d.ts +0 -19
- package/dist/node/chunks/dep-3RmXg9uo.js +0 -553
- package/dist/node/chunks/dep-Bn81Esdm.js +0 -49496
- package/dist/node/chunks/dep-CvfTChi5.js +0 -8218
- package/dist/node/chunks/dep-D5ITTxnT.js +0 -7113
- package/dist/node/chunks/dep-SOJpRpBL.js +0 -822
- package/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts +0 -87
- package/dist/node-cjs/publicUtils.cjs +0 -3986
- package/index.cjs +0 -96
- package/index.d.cts +0 -6
package/index.cjs
DELETED
@@ -1,96 +0,0 @@
|
|
1
|
-
const description =
|
2
|
-
' See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.'
|
3
|
-
|
4
|
-
warnCjsUsage()
|
5
|
-
|
6
|
-
// type utils
|
7
|
-
module.exports.defineConfig = (config) => config
|
8
|
-
|
9
|
-
// proxy cjs utils (sync functions)
|
10
|
-
Object.assign(module.exports, require('./dist/node-cjs/publicUtils.cjs'))
|
11
|
-
|
12
|
-
// async functions, can be redirect from ESM build
|
13
|
-
const asyncFunctions = [
|
14
|
-
'build',
|
15
|
-
'createServer',
|
16
|
-
'preview',
|
17
|
-
'transformWithEsbuild',
|
18
|
-
'resolveConfig',
|
19
|
-
'optimizeDeps',
|
20
|
-
'formatPostcssSourceMap',
|
21
|
-
'loadConfigFromFile',
|
22
|
-
'preprocessCSS',
|
23
|
-
'createBuilder',
|
24
|
-
'runnerImport',
|
25
|
-
]
|
26
|
-
asyncFunctions.forEach((name) => {
|
27
|
-
module.exports[name] = (...args) =>
|
28
|
-
import('./dist/node/index.js').then((i) => i[name](...args))
|
29
|
-
})
|
30
|
-
|
31
|
-
// variables and sync functions that cannot be used from cjs build
|
32
|
-
const disallowedVariables = [
|
33
|
-
// was not exposed in cjs from the beginning
|
34
|
-
'parseAst',
|
35
|
-
'parseAstAsync',
|
36
|
-
'buildErrorMessage',
|
37
|
-
'sortUserPlugins',
|
38
|
-
// Environment API related variables that are too big to include in the cjs build
|
39
|
-
'DevEnvironment',
|
40
|
-
'BuildEnvironment',
|
41
|
-
'createIdResolver',
|
42
|
-
'createRunnableDevEnvironment',
|
43
|
-
// can be redirected from ESM, but doesn't make sense as it's Environment API related
|
44
|
-
'fetchModule',
|
45
|
-
'moduleRunnerTransform',
|
46
|
-
// can be exposed, but doesn't make sense as it's Environment API related
|
47
|
-
'createServerHotChannel',
|
48
|
-
'createServerModuleRunner',
|
49
|
-
'createServerModuleRunnerTransport',
|
50
|
-
'isRunnableDevEnvironment',
|
51
|
-
'createFetchableDevEnvironment',
|
52
|
-
'isFetchableDevEnvironment',
|
53
|
-
]
|
54
|
-
disallowedVariables.forEach((name) => {
|
55
|
-
Object.defineProperty(module.exports, name, {
|
56
|
-
get() {
|
57
|
-
throw new Error(
|
58
|
-
`${name} is not available in the CJS build of Vite.` + description,
|
59
|
-
)
|
60
|
-
},
|
61
|
-
})
|
62
|
-
})
|
63
|
-
|
64
|
-
function warnCjsUsage() {
|
65
|
-
if (process.env.VITE_CJS_IGNORE_WARNING) return
|
66
|
-
const logLevelIndex = process.argv.findIndex((arg) =>
|
67
|
-
/^(?:-l|--logLevel)/.test(arg),
|
68
|
-
)
|
69
|
-
if (logLevelIndex > 0) {
|
70
|
-
const logLevelValue = process.argv[logLevelIndex + 1]
|
71
|
-
if (logLevelValue === 'silent' || logLevelValue === 'error') {
|
72
|
-
return
|
73
|
-
}
|
74
|
-
if (/silent|error/.test(process.argv[logLevelIndex])) {
|
75
|
-
return
|
76
|
-
}
|
77
|
-
}
|
78
|
-
const yellow = (str) => `\u001b[33m${str}\u001b[39m`
|
79
|
-
console.warn(
|
80
|
-
yellow("The CJS build of Vite's Node API is deprecated." + description),
|
81
|
-
)
|
82
|
-
if (process.env.VITE_CJS_TRACE) {
|
83
|
-
const e = {}
|
84
|
-
const stackTraceLimit = Error.stackTraceLimit
|
85
|
-
Error.stackTraceLimit = 100
|
86
|
-
Error.captureStackTrace(e)
|
87
|
-
Error.stackTraceLimit = stackTraceLimit
|
88
|
-
console.log(
|
89
|
-
e.stack
|
90
|
-
.split('\n')
|
91
|
-
.slice(1)
|
92
|
-
.filter((line) => !line.includes('(node:'))
|
93
|
-
.join('\n'),
|
94
|
-
)
|
95
|
-
}
|
96
|
-
}
|