You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
401 B
TypeScript
17 lines
401 B
TypeScript
const hasWarned: Record<string, boolean> = {}
|
|
|
|
export function warnOnce(msg: string) {
|
|
const isNodeProd =
|
|
typeof process !== 'undefined' && process.env.NODE_ENV === 'production'
|
|
if (!isNodeProd && !hasWarned[msg]) {
|
|
hasWarned[msg] = true
|
|
warn(msg)
|
|
}
|
|
}
|
|
|
|
export function warn(msg: string) {
|
|
console.warn(
|
|
`\x1b[1m\x1b[33m[@vue/compiler-sfc]\x1b[0m\x1b[33m ${msg}\x1b[0m\n`
|
|
)
|
|
}
|