Skip to content

tokTypes of acorn-jsx will be different TokenType classes if acorn itself is loaded via ESM #133

@JounQin

Description

@JounQin

acorn-jsx/index.js

Lines 85 to 91 in de5b1e9

Object.defineProperty(module.exports, "tokTypes", {
get: function get_tokTypes() {
return getJsxTokens(require("acorn")).tokTypes;
},
configurable: true,
enumerable: true
});

acorn can be loaded as ESM: https://github.com/acornjs/acorn/blob/master/acorn/package.json#L11

But the above codes enforces to load cjs version of acorn, it will cause the problem described as title.

related #112

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