franleplant / require-less

Browserify transform to require('file.less')
MIT License
1 stars 0 forks source link

Browserify plugin #2

Open uipoet opened 10 years ago

uipoet commented 10 years ago

Understandably, this module can't work as a typical transform, but what about as a plugin?

browserify -e index.js -p [ require-less -o ./bundle.css ] -o ./bundle.js
franleplant commented 10 years ago

TLDR

This wont work as a plugin either.

The reason:

require-less is a transform factory, and you need to execute the factory with the desired parameters in order to "get" the transform itself and hence use it.

This plugin is experimental and some what weird in the browserify world, maybe in the future we can accomplish this but for now you need to do it programmatic fashion.

uipoet commented 10 years ago

Thanks for the explanation. Staying tuned as you make progress. Please feel free to mark this one closed or keep open for others wondering the same. Unrelated: in the README, I initially mistook the example showing what this module is not (inlined CSS from LESS). Might want to make the example of what it actually is more prominent. Colors of syntax highlighting drew me in and missed the point, initially.

franleplant commented 10 years ago

Will do! Thanks!

Fran