Closed lastmjs closed 5 years ago
That would be superb! Let me take a look at how difficult this would be and I'll get back to you.
Awesome! If it helps, I've done this kind of thing before on a few occasions:
And there are many others in the repo list: https://github.com/Prendus
Yeah I've done it a bit before as well. This already uses rollup so I think it's just a matter of adding a second build target. I'll probably go with page.mjs
since page.js
is the UMD bundle.
Do you know what is supposed to be done about the package.json so that bundlers prefer this new bundle? Is that the module
field?
I'm not sure, but I believe I've seen module
and esm
. module
would probably be preferred: https://stackoverflow.com/questions/42708484/what-is-the-module-package-json-field-for
This is in 1.9.0: https://github.com/visionmedia/page.js/releases/tag/v1.9.0
Could you provide a rollup bundle that emits es modules? I'm working with tools (trying to work with no tools) that just assume es module source code. Bare specifiers are fine, but having the require syntax in the bundle is messing things up for me. It would be nice if page could have a module output, and for that to be in the "es" or "module" property of the package.json. I bring this up because I'm trying to use
sk-router
and ran into this issue: https://github.com/skatejs/skatejs/issues/1514