Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/vite/index.cjs

    rd565449 r0c6b92a  
    1 /* eslint-disable no-restricted-globals */
    2 
    31warnCjsUsage()
    42
     
    75
    86// proxy cjs utils (sync functions)
    9 // eslint-disable-next-line n/no-missing-require -- will be generated by build
    107Object.assign(module.exports, require('./dist/node-cjs/publicUtils.cjs'))
    118
     
    2926function warnCjsUsage() {
    3027  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      return
     38    }
     39  }
    3140  const yellow = (str) => `\u001b[33m${str}\u001b[39m`
    32   const log = process.env.VITE_CJS_TRACE ? console.trace : console.warn
    33   log(
     41  console.warn(
    3442    yellow(
    35       `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.`,
     43      `The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.`,
    3644    ),
    3745  )
     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  }
    3860}
Note: See TracChangeset for help on using the changeset viewer.