.
This commit is contained in:
parent
0908fe53f3
commit
e2bb1b7ca2
4 changed files with 25 additions and 11 deletions
|
|
@ -46,13 +46,20 @@ export const logger =
|
|||
app = `DEV-${app}`
|
||||
}
|
||||
|
||||
const isNode =
|
||||
typeof process !== "undefined" &&
|
||||
process.versions?.node &&
|
||||
process.versions.node !== ""
|
||||
const isNode = () => {
|
||||
try {
|
||||
return (
|
||||
typeof process !== "undefined" &&
|
||||
process.versions?.node &&
|
||||
!process.versions.electron
|
||||
)
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (isNode && typeof __filename !== "undefined") {
|
||||
if (isNode() && typeof __filename !== "undefined") {
|
||||
// Modifica apenas se estiver em Node.js e as variáveis existirem
|
||||
__filename = __filename.replace(process.cwd(), "")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue