Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Method for determining a recompile #124

Open
duhseekoh opened this issue Feb 26, 2015 · 1 comment
Open

Enhancement: Method for determining a recompile #124

duhseekoh opened this issue Feb 26, 2015 · 1 comment

Comments

@duhseekoh
Copy link

In the preprocess.less method I'm pulling variables from somewhere else in the app that are ran through lodash templating to produce some new LESS code to append to my less src that is returned from this preprocess.less method. That way, I'm able to dynamically inject and override LESS variables.

This is great and works well. However, I want to recompile when those external variables I'm interpolating into a template have changed since the last time I compiled. The middleware currently only recompiles based on mtimes and import paths, but none of that has changed in the preprocess modification scenario.

If there were another preprocess method like shouldCompile: function(src, req) that returned a boolean, it'd give the necessary control. If that method isn't defined or returns false, it could still perform your normal check on mtimes and less imports.

Thoughts?

@talha-asad
Copy link

I think that is a good idea. Would work for almost all use cases without much overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants