Closed ropez closed 9 years ago
Thanks for reminding me of this
relates to https://github.com/jsdf/browserify-incremental/issues/2
Okay firstly for this to work, lessify would need to emit a 'file' event for each less file which is required from a particular module (js/coffee/etc file) and all of its less imports. The brfs transform has an example of this.
No problem.
Is there anything I can do to help. Check if this can be done in lessify, and do a PR if necessary?
Yep, that would definitely help.
I figured it should be as simple as this: https://github.com/snaptv/lessify/commit/f6ee2d68811a4a428859d56ce78012536fe4ded6
Do we actually need to emit an event for each imported file, or can we allow the argument to contain the whole array in a single event? I'm not very familiar with the API, I'm not sure if there's an "official" spec for this 'file' event.
I haven't sent a PR yet, waiting for feedback here first.
(btw, I found out there are two lessify modules, node-lessify and lessify. I'm using the latter, not the one I linked to in the original post)
The 'spec' is 'whatever watchify does', which you can see here. browserify-incremental fulfils the same role as watchify here, and lessify would be doing the equivalent of brfs. watchify and brfs are written by @substack – that's about as close as there is to a spec for this particular mechanism.
Ok, I've tested this patched lessify with watchify, and it does the trick. I'm sending a pull request to lessify.
So, the missing pieces have now been merged:
https://github.com/dstokes/lessify/pull/7 https://github.com/jsdf/browserify-cache-api/pull/1
What remains to be able to use this feature is to update the dependency here, and publish new versions to npm. I don't think I can PR tagging and uploading, any chance of a new version in the nearest future?
published 3.0.0
Thank you
When used with lessify
Changes to less files included in an
@import
statement doesn't cause the output to be updated. You have to touch the main less file to trigger an update.Example:
When a cache exists, chaning
foo.less
doesn't cause the resulting CSS inmain.coffee
to change. I have to runtouch main.less
to cause an update.