Skip to content

In ES module "__filename" is not defined #81

@crystalfp

Description

@crystalfp

I bundle with rollup my application (that uses indirectly this module) as an ES module. The bundle fails at runtime because __filename is not defined.
Could the following alternative be added if __filename is not defined?

import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url)

Thanks!
mario

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions