acornjs / acorn-jsx

Alternative, faster React.js JSX parser
MIT License
648 stars 72 forks source link

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

Open JounQin opened 2 years ago

JounQin commented 2 years ago

https://github.com/acornjs/acorn-jsx/blob/de5b1e94812c7bb225bb055527f700617cebb6d7/index.js#L85-L91

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