Open pixeldrew opened 9 years ago
+1 for this. I tried to use https://github.com/JedWatson/react-select in my AMD project and met the same problem. A tip for anyone who needs UMD support, I was able to do it with this: https://github.com/mondaychen/react-select/commit/f6c87d2f8081e04afc8c3749c590484c2efe09af . Probably not the best way but works.
I tried to rewrite this library to use https://github.com/eduardolundgren/gulp-umd instead of browserify-shim, but couldn't get it to work. I always end up with an empty file as dist-script. I can however create a PR with what I have, maybe someone who is more experienced with node and gulp can tell me what I'm doing wrong.
See #25
browserify-shim incorrectly rewrites require('react') to (window.React).
in a new version of browserify-shim, it rewrites to this (which is still broken):
This might not be a bug but by the design of browserify-shim. It should be mentioned in your docs that the output of react-components-gulp-tasks will not be A/UMD compatible.
I was able to successfully make a UMD build using webpack.