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

Add a Rollup-compatible ES modules build #9

Closed
gaearon opened this issue May 20, 2016 · 6 comments · Fixed by #10
Closed

Add a Rollup-compatible ES modules build #9

gaearon opened this issue May 20, 2016 · 6 comments · Fixed by #10

Comments

@gaearon
Copy link
Contributor

gaearon commented May 20, 2016

Redux depends on this library now, which breaks ES modules build of Redux. It would be great if we could offer an ES modules build of this library in /es/ and point jsxnext:main to it.

@benlesh
Copy link
Owner

benlesh commented May 20, 2016

Seems reasonable

@benlesh
Copy link
Owner

benlesh commented May 21, 2016

@gaearon I just thought of something (Although I haven't looked into this yet). Recreating this with ES6 will need to be done by hand I think, because if I rewrite it in ES6, the transpiled CJS will require it to be used like require('symbol-observable').default I think. That will be a breaking change for everyone using this. :\

@jamestalmage
Copy link
Collaborator

jamestalmage commented May 21, 2016

If you are only exporting a default. You can use this: https://www.npmjs.com/package/babel-plugin-add-module-exports.

There were good reasons babel changed the behavior though: https://phabricator.babeljs.io/T2212#57710

@gaearon
Copy link
Contributor Author

gaearon commented May 21, 2016

You can use this: https://www.npmjs.com/package/babel-plugin-add-module-exports.

Yeah, this is what I had in mind. I haven’t tried it though.

@benlesh
Copy link
Owner

benlesh commented May 21, 2016

@jamestalmage oh, thanks, I didn't know about the plugin. I just knew the reasons babel wouldn't do it. It's probably totally safe for this project, since there's just the one export.

benlesh added a commit that referenced this issue May 21, 2016
The build now comes from the files under the `es/` directory.

closes #9
benlesh added a commit that referenced this issue May 21, 2016
The build now comes from the es2015 files under the `es/` directory.

closes #9
@PalermoD
Copy link

Thanks that worked great

benlesh added a commit that referenced this issue May 28, 2016
* feat(es2015): add es2015 implementation to support rollup

The build now comes from the es2015 files under the `es/` directory.

closes #9

* chore(package): add es files and lib files to npm files

* chore(package): ensure build and test before publish

* refactor(ponyfill): make Symbol const

* chore(ponyfill test): update tests to look at built file

* refactor(all): ensure only es6 feature used is modules
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 a pull request may close this issue.

4 participants