Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Document how files are determined to be CommonJS #88

Closed
lkmill opened this issue Aug 20, 2016 · 2 comments
Closed

Document how files are determined to be CommonJS #88

lkmill opened this issue Aug 20, 2016 · 2 comments

Comments

@lkmill
Copy link

lkmill commented Aug 20, 2016

it would be great if there was a note in the documentation how rollup-plugin-commonjs determines if a file is CommonJS. For example, the fact that the existence of a reference to globals causes the file to be interpreted as CommonJS is not super obvious, even if the package.json uses jsnext:main or module.

@Rich-Harris
Copy link
Contributor

Yeah, this should be spelled out a bit more clearly. I'd actually be in favour of implementing something along the unambiguous grammar proposal – i.e. if there's an import or export anywhere, it's not CommonJS (and only once we've failed to find import/export do we look for CommonJS features)

@shellscape
Copy link
Contributor

Hey folks (this is a canned reply, but we mean it!). Thanks to everyone who participated in this issue. We're getting ready to move this plugin to a new home at https://github.com/rollup/plugins, and we have to do some spring cleaning of the issues to make that happen. We're going to close this one, but it doesn't mean that it's not still valid. We've got some time yet before the move while we resolve pending Pull Requests, so if this issue is still relevant, please @ me and I'll make sure it gets transferred to the new repo. 🍺

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants