We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15871c7 commit 5c5f82cCopy full SHA for 5c5f82c
packages/vite/index.cjs
@@ -38,10 +38,23 @@ function warnCjsUsage() {
38
}
39
40
const yellow = (str) => `\u001b[33m${str}\u001b[39m`
41
- const log = process.env.VITE_CJS_TRACE ? console.trace : console.warn
42
- log(
+ console.warn(
43
yellow(
44
`The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.`,
45
),
46
)
+ if (process.env.VITE_CJS_TRACE) {
47
+ const e = {}
48
+ const stackTraceLimit = Error.stackTraceLimit
49
+ Error.stackTraceLimit = 100
50
+ Error.captureStackTrace(e)
51
+ Error.stackTraceLimit = stackTraceLimit
52
+ console.log(
53
+ e.stack
54
+ .split('\n')
55
+ .slice(1)
56
+ .filter((line) => !line.includes('(node:'))
57
+ .join('\n'),
58
+ )
59
+ }
60
0 commit comments