Skip to content

How to use CommonJS modules in Compartment? #1788

@GulgDev

Description

@GulgDev

You can use import to run code as ESM. But is it possible to use require, module.exports and other CommonJS features in compartments?
I don't think there's built-in support for this functions. Can I emulate their behaviour? And if I can, how do I do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions