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

Mimosa watch does not update unmodified files whose dependencies have changed and are of a different template type #323

Closed
daedalus28 opened this issue Dec 13, 2013 · 2 comments

Comments

@daedalus28
Copy link

As of version 1.3.0, Mimosa watch does not update unmodified less files when their dependencies change, if their dependencies are not also less files (ie css files). In the case of an @import (less) "dependency.css"; in a styles.less file, any modifications to dependency.css will not trigger a recompile of styles.less

See the thread I started on the google group here for more info: https://groups.google.com/forum/#!topic/mimosajs/sRRfnP_pfrI

I've summarized the info from the thread below:

One proposed solution was to write a module that takes a list of root less files to watch in its config and walks its dependency graph of imports (in the example, it would just be styles.less). The module would then watch for changes to any of those files and then recompile anything that depends on it by walking the dependency graph, updating the graph along the way so that new files can be imported without restarting Mimosa watch. The downside of this is that it is a one off fix and doesn't generically solve the issue.

A better solution would be to extend the Mimosa core to expose a hook to modules/compilers that looks something like detectDepencies(source), which takes the file source as a parameter and returns a list of file paths that it depends on. Doing it generically like this seems to be an elegant and powerful solution to the problem. This approach seems like right way to go, and is well timed considering the upcoming 2.0 compiler rewrite.

@dbashford
Copy link
Owner

The mechanism to do all this is in place already. Files are scanned for dependencies, trees are built, etc. It just needs to be modified to look for and manage .less files and the CSS compilers need to have .css files flow through them which they do not right now.

I hope to have this in place for less and stylus in the next day or two.

@dbashford
Copy link
Owner

Getting close on this. Not a lot of code but touches a lot of things. Getting one compiler handle another's files is a bit tricky.

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

No branches or pull requests

2 participants