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

jsnext:main should not point to completely untranspiled code #22

Closed
wdhorton opened this issue Aug 4, 2016 · 5 comments
Closed

jsnext:main should not point to completely untranspiled code #22

wdhorton opened this issue Aug 4, 2016 · 5 comments

Comments

@wdhorton
Copy link

wdhorton commented Aug 4, 2016

From the Rollup docs:

jsnext:main will point to a module that has ES2015 module syntax but otherwise only syntax features that node supports.

Libraries that expose an ES6 module build should transpile the code in a way that makes it ES5-compatible, but leaves "import" and "export" statements intact. The reason is that we can't transpile all node_modules for a project, nor would we know what babel config to use on each of them. See this conversation for more discussion. Pointing "jsnext:main" to a file with the "class" keyword is breaking our build.

@chaintng
Copy link
Contributor

+1

1 similar comment
@javatask
Copy link

+1

@bjyoungblood
Copy link
Owner

Fixed by #23

@delta62
Copy link
Contributor

delta62 commented Sep 29, 2016

Unfortunately, this appears to be broken in a different way now. The jsnext:main field is indeed pointing to code that node can run, but the exports are no longer compatible with the es2015 format:

exports.default = ExtendableError;
module.exports = exports['default'];

That is commonJS module syntax. The file that jsnext:main points to should be doing:

export default ExtendableError;

Should we reopen the issue and track that here, or should I open a new issue for it?

@bjyoungblood
Copy link
Owner

See #25

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

No branches or pull requests

5 participants