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

[proposal] commonjs mods can only export default #6

Open
caridy opened this issue Nov 6, 2014 · 9 comments
Open

[proposal] commonjs mods can only export default #6

caridy opened this issue Nov 6, 2014 · 9 comments

Comments

@caridy
Copy link
Owner

caridy commented Nov 6, 2014

based on this discussion: babel/babel#95 (comment)

@ericf
Copy link
Contributor

ericf commented Nov 7, 2014

Why can't CommonJS modules use only named exports?

@caridy
Copy link
Owner Author

caridy commented Nov 7, 2014

@ericf check the discussion from the link, there is a lot of info there about why we should probably do that.

@caridy caridy changed the title commonjs mods can only export default [proposal] commonjs mods can only export default Nov 7, 2014
@ericf
Copy link
Contributor

ericf commented Nov 7, 2014

@caridy I read the whole post. But passed on the title of this issue and it's lack of description, I'm asking for some clarity, because I don't understand what you're proposing.

@caridy
Copy link
Owner Author

caridy commented Nov 7, 2014

ah, ok. This pkg contains an npm module resolver that detects npm dependencies and creates a synthetic es6 module that contains named exports for any member of the module.exports object. This is used today to validate that in deed, those CJS modules are suppose to export what ES6 modules are trying to import. The proposal is to narrow that down to only support default import from CJS modules.

@ericf
Copy link
Contributor

ericf commented Nov 7, 2014

I thought this package only deals with resolving ES6 imports of other ES6 modules that are in other npm packages. Where does this package deal with looking at CommonJS modules? 😕

@ericf
Copy link
Contributor

ericf commented Nov 7, 2014

those CJS modules are suppose to export what ES6 modules are trying to import.

I don't follow this.

@ericf
Copy link
Contributor

ericf commented Nov 7, 2014

The proposal is to narrow that down to only support default import from CJS modules.

Where does this package import CJS modules today? I thought it only produces CJS modules via the transpiler.

@caridy
Copy link
Owner Author

caridy commented Nov 7, 2014

@caridy
Copy link
Owner Author

caridy commented Nov 7, 2014

that obviously means we need to change all our pkgs.

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

2 participants