Enable lessify transform (compatability)#412
Enable lessify transform (compatability)#412MattMcFarland wants to merge 1 commit intoJedWatson:masterfrom MattMcFarland:patch-1
Conversation
[Per the Browserify Handbook](https://github.com/substack/browserify-handbook#browserifytransform-field) - Since you are using less and react, it makes good sense to use lessify in the package.json just for the sake of optimal compatibility. Without adding this simple line of code, developers and engineers who are using browserify cannot transform the less files when using package.json. For the time being, I've had to copy the less files from react-select to my src directory. However, if you put at least "lessify" in as a transform, reat-select will work for all of us who are using lessify as a transform in our package.json.
|
Please read here too: https://github.com/substack/browserify-handbook#node_modules
Again, I really thought react-select was broken because the stylesheets would not load when I used require('react-select') - I thought it was just another dud react component that doesnt work but after further investigation I found that your package.json is missing the transform field for browserify. Please add this, if not at least explain why it would be unhelpful to have this. People using browserify with lessify in package.json instead of transforms in a task-runner could easily dismiss this product as being a dud if they don't investigate. |
|
@JedWatson have you looked at this PR yet? |
|
Thanks for the PR @MattMcFarland This shouldn't be necessary anymore with our new build system. Please let me know if it's still relevant. |
Per the Browserify Handbook + node_modules transforms don't apply across module boundaries.
Since you are using less, it makes good sense to add the browserify transform field to your package.json so other modules that use react-select as a dependency may transform react-select's .less files simply using browserify's native transform configuration. I personally find it more useful to use transforms in the package file instead of adding tasks to my task runner that use external plugins that may go out of date and lose compatibility with browserify.
This pull request adds the transform field to improve compatibility.