| @@ -25,6 +25,18 @@ asyncFunctions.forEach((name) => { |
|
|
| 25 |
25 |
|
| 26 |
26 |
function warnCjsUsage() { |
| 27 |
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' | |
|
34 |
+return |
|
35 |
+} |
|
36 |
+if (/silent|error/.test(process.argv[logLevelIndex])) { |
|
37 |
+return |
|
38 |
+} |
|
39 |
+} |
| 28 |
40 |
const yellow = (str) => `\u001b[33m${str}\u001b[39m` |
| 29 |
41 |
const log = process.env.VITE_CJS_TRACE ? console.trace : console.warn |
| 30 |
42 |
log( |