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

false positives for commonjs check #53

Closed
calvinmetcalf opened this issue Mar 14, 2016 · 5 comments
Closed

false positives for commonjs check #53

calvinmetcalf opened this issue Mar 14, 2016 · 5 comments

Comments

@calvinmetcalf
Copy link
Contributor

currently any mention of require, module and exports causes a module to be flagged as commonjs and in need of transpiling even if it's something like var a=typeof require=="function"&&require; (which is part of browserify bundles). Might make sense to do a second, more in depth parse of the files to make sure it really is one.

@TrySound
Copy link
Member

ref #38

@calvinmetcalf
Copy link
Contributor Author

yeah this may be a false positive on my part here

calvinmetcalf added a commit to calvinmetcalf/rollup-plugin-commonjs that referenced this issue Mar 14, 2016
@calvinmetcalf
Copy link
Contributor Author

wait no, there are certain things that will trigger a wrap including typeof foo checks and (ironically) the global check that uses global only if it's present

calvinmetcalf added a commit to calvinmetcalf/rollup-plugin-commonjs that referenced this issue Mar 15, 2016
calvinmetcalf added a commit to calvinmetcalf/rollup-plugin-commonjs that referenced this issue Mar 17, 2016
@Rich-Harris
Copy link
Contributor

Just doing some housekeeping – is this still a live issue or can it be closed? import and export prevent a module from being treated as CommonJS, I don't think there are any other cases where a false positive would be truly problematic?

@calvinmetcalf
Copy link
Contributor Author

This was opened on like v3 so I'll reopen if it's still an issue

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

No branches or pull requests

3 participants