Support non-esm modules #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "kapouer/nonesm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The simplicity of it is so cool. It's a proof-of-concept however - i'm a noobie w.r.t. acorn.
Did github mangle the
(code.charAt(ast.start) == "" ? "" : "")expressions or is there something I don't understand going on there?Not github, me - to be able to diff i removed semicolons too agressively.
That should fix it
I don't expect these PR to be accepted right away - please consider them as inspiration, if that's not too much to ask :)
What do you want to do with
requirecalls?Nothing: most front-end modules come in a single require-able bundle, so exporting module.exports using that patch, es6-style, is just enough to be able to import the npm-installed bundled module.
Though replacing
require xbyimport from xwould be elegant but i fear the hidden complexities.In my experience the concept of dependencies is definitely also used in many front-end modules. So shipping a solution that just ignores that doesn't feel very reasonable. (I intentionally didn't provide any support for non-ES modules initially because I'm not that interested in being pulled into the morass of trying to make this work.)
Pull request closed