codewithmichael / babel-browser-harness

In-browser CDN-based ES6+ transpiling via Babel
MIT License
1 stars 0 forks source link

Auto-load React libs with "react" Babel preset #10

Closed codewithmichael closed 8 years ago

codewithmichael commented 8 years ago

Proposal

React is a common use case for Babel, which is why there's a built-in transpiler option for it.

I propose we auto-load the React libraries if the react preset is enabled and no React libs have been mapped via bbh.modules.

Devs could still load their own preferred versions (or no version at all using ignores), but a recent version would be loaded for them if they didn't handle it manually.

Caveat

As there could be conflicts if someone opted to mock React in a custom local script, it's sensible to have a config option to disable auto-loading—e.g. bbh.autoloadReact = false

codewithmichael commented 8 years ago

PR #20 resolves this issue. Marking in review for further testing.