You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
The text was updated successfully, but these errors were encountered:
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.
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 astyles.less
file, any modifications todependency.css
will not trigger a recompile ofstyles.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.The text was updated successfully, but these errors were encountered: