0

As title said, I found that in rollup-plugin-commonjs, it check AST by 'import' and 'export' to judge if it is esmodule. After check, it also check commonJs keywords like 'require/module/exports', and seem only transform commonJs which has export info. How should I solve a module without keywords from esm or cjs? Can i regard the module as esm and bundle it with rollup?

D.H.Lolo
  • 53
  • 4
  • 1
    `import` and `export` are not the only indicators for modules. There’s also top-level `await`, and several module scope semantics, strict mode semantics, removal of deprecated code, etc. This isn’t very trivial to do. – Sebastian Simon Nov 15 '22 at 13:31

0 Answers0