.
This commit is contained in:
parent
6a0da63093
commit
0908fe53f3
4 changed files with 31 additions and 8 deletions
|
|
@ -46,11 +46,23 @@ export const logger =
|
|||
app = `DEV-${app}`
|
||||
}
|
||||
|
||||
const isNode = typeof process !== "undefined" && process.versions?.node
|
||||
const isNode =
|
||||
typeof process !== "undefined" &&
|
||||
process.versions?.node &&
|
||||
process.versions.node !== ""
|
||||
|
||||
if (isNode && __filename) {
|
||||
__filename = __filename.replace(process.cwd(), "")
|
||||
try {
|
||||
if (isNode && typeof __filename !== "undefined") {
|
||||
// Modifica apenas se estiver em Node.js e as variáveis existirem
|
||||
__filename = __filename.replace(process.cwd(), "")
|
||||
}
|
||||
} catch (error) {
|
||||
// Ignora erros de variáveis não definidas no navegador
|
||||
if (!(error instanceof ReferenceError)) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
if (local) {
|
||||
detalhes = [`${nomeVariavel({ local })}="${local}"`]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue