Skip to content

Enhancement: Method for determining a recompile #124

Open
@duhseekoh

Description

@duhseekoh

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions