Skip to content

ESM imports not working properly #502

@ivank

Description

@ivank

Cannot be imported as an ESM module since the code dynamically loads a dependency via "require".

That require is still there in the "compiled" ES file https://www.npmjs.com/package/turndown?activeTab=code.

Line in question:

var domino = require('@mixmark-io/domino')

I was able to successfully use this by copy-pasting this whole file and rewriting the require to an import.

I understand that you don't want to add the dependency for browsers but this style of optional imports need to be rewritten properly with an import() function I guess.

Alternatively, you could specify the domino dependency as a peer dependency, and let people in the node environment supply it themselves.

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