Commit 5c5f82c 1 parent 15871c7 commit 5c5f82c Copy full SHA for 5c5f82c
File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,23 @@ function warnCjsUsage() {
38
38
}
39
39
}
40
40
const yellow = ( str ) => `\u001b[33m${ str } \u001b[39m`
41
- const log = process . env . VITE_CJS_TRACE ? console . trace : console . warn
42
- log (
41
+ console . warn (
43
42
yellow (
44
43
`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
44
) ,
46
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
+ }
47
60
}
You can’t perform that action at this time.
0 commit comments