This commit is contained in:
Luiz Silva 2025-02-22 18:13:52 -03:00
parent 0908fe53f3
commit e2bb1b7ca2
4 changed files with 25 additions and 11 deletions

View file

@ -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(), "")
}