I am using LESS with my node.js setup on my Windows dev machine. I’ve noticed that changes made to my .less file do not cause my .css file to be regenerated. If I want to see these changes, I am forced to delete the .css file. This will be regenerated the next time a request is made.
I was under the impression that the .css file was supposed to be regenerated after every change to the .less file (comparing the last modified date). I was curious if this was an issue specific to Windows.
Furthermore, I’ve noticed that the first request for a .css file forces it to be generated, but a 404 will be returned to the browser (aka no styles show up). Subsequent requests will find the .css file. I want to avoid ruining the first, unlucky user’s experience.
Sounds to me like you are using express and/or connect middleware and you have your static handler before your compiler handler in the app configuration.
Switch them around.
The compiler will then get a chance to handle the request, seeing the file needs (re)compilation and once that is done the static handler kicks in and serves it.