We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ca53cf commit dc3c14fCopy full SHA for dc3c14f
packages/vite/index.cjs
@@ -25,6 +25,18 @@ asyncFunctions.forEach((name) => {
25
26
function warnCjsUsage() {
27
if (process.env.VITE_CJS_IGNORE_WARNING) return
28
+ const logLevelIndex = process.argv.findIndex((arg) =>
29
+ /^(?:-l|--logLevel)/.test(arg),
30
+ )
31
+ if (logLevelIndex > 0) {
32
+ const logLevelValue = process.argv[logLevelIndex + 1]
33
+ if (logLevelValue === 'silent' || logLevelValue === 'error') {
34
+ return
35
+ }
36
+ if (/silent|error/.test(process.argv[logLevelIndex])) {
37
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(
0 commit comments