Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create separate main (umd) and jsnext:main (es6) builds #45

Merged
merged 4 commits into from
Jan 19, 2016
Merged

Conversation

Rich-Harris
Copy link
Owner

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 the jsnext part should only refer to the method of export (i.e. ES6 import and export statements, in contrast to the UMD export block at the top of the ES5 dist file indicated by the main 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 to dist/ramjet.es6.js and not src/ramjet.js. The regular dist file is renamed from dist/ramjet.js to dist/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.

Rich-Harris added a commit that referenced this pull request Jan 19, 2016
create separate main (umd) and jsnext:main (es6) builds
@Rich-Harris Rich-Harris merged commit 719fd12 into master Jan 19, 2016
@Rich-Harris Rich-Harris deleted the jsnext branch January 19, 2016 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant