andrewhathaway / Winterfell

Generate complex, validated and extendable JSON-based forms in React.
http://winterfell.andrewhathaway.net
MIT License
785 stars 116 forks source link

Specify transform in package.json for browserify support #11

Closed jwbrady closed 9 years ago

jwbrady commented 9 years ago

If you use the "browserify.transform" feature, it will make it easier for those who also use browserify at the app level to use your npm package. The two changes required to your package.json are: add a dependency on reactify (you currently only have a dev dependency), add at the below line.

"browserify": { "transform": [ ["reactify",{"es6":true}] ] }

You may also wish to consider using babelify instead. It is based on the babel project which is replacing the react-tools project that reactify is based on. If you do, you can use this line instead (as well as a dependency on babelify):

"browserify": { "transform": [ "babelify" ] }
andrewhathaway commented 9 years ago

Great idea. I shall update and commit in the morning. I thought I was using babelify, weird. I shall also switch that out too!

Thanks for the tip.

jwbrady commented 9 years ago

Turns out, by doing both #12 and #13, it now does extra unnecessary work. Since you targeted the precompiled code using main in package.json, browserify no longer needs babelify, but still applies it due to #12. I suggest removing the browserify.transform field in package.json.