create separate main (umd) and jsnext:main (es6) builds #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
not ready for merge – I'm just leaving this here in case the next chance I get to work on it is at a different computer.
Ramjet exposes a
jsnext:main
field in its package.json, which allows ES6-aware module bundlers like Rollup to work with it natively. After some discussion and some hard-won experience, I've come to the view that thejsnext
part should only refer to the method of export (i.e. ES6import
andexport
statements, in contrast to the UMD export block at the top of the ES5 dist file indicated by themain
field of package.json), and not to other ES6 language features like arrow functions and destructuring. That way, code that consumes Ramjet only needs to worry about transpiling its own ES6 stuff, not anyone else's.So as of this PR,
jsnext:main
points todist/ramjet.es6.js
and notsrc/ramjet.js
. The regular dist file is renamed fromdist/ramjet.js
todist/ramjet.umd.js
, because that's what it is.It's not ready for merge because it uses a version of Rollup that will be released in the next couple of days.