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 much as I like the idea of adding environment support, this change makes certain assumptions that will cause problems with certain filters. For instance, the compass filter creates a .sass-cache folder in the project directory where nanoc compile is run. It's quite possible other filters may create temporary folders where files are cached.
As a result, the only safe way to use this feature is to only compile to one environment in a given project folder and not compile different environments in the same project folder.
Sure it's possible to configure the sass compiler to cache to a specific location but the setup is complicated because the environment setting needs to be passed to the compass config.rb and used to set the sass :cache_location property. Not only that, the configuration has to be made to config.rb so it's possible to run the compass command by itself outside of nanoc and have it pick up the right environment location.
Compass also supports environments so it would be ideal if the environment setting configured for Nanoc could be passed into the compass config.rb but that's a bit beyond the current topic.
However, aside from the filters nanoc supports out of the box, even if all of them were reviewed and fixed if necessary, there's no guarantee that third-party filters aren't writing or caching files to the project directory.
Even if switching environments to compile into the same folder is not supported, environment support is still very useful when building with one environment configuration such as development in its own folder, then push changes to a Git repository, e.g. github.com, then in a different folder configured as the production environment perform a git pull and recompile.
I see two action points here:
Verify that all built-in filters behave properly when switching environments.
Ensure that the documentation for writing filters explicitly mentions that caches might become invalid due to an environment switch. This might mean that filters need to have access to the current environment, which is currently not the case.
The text was updated successfully, but these errors were encountered:
This might be not so much of an issue if the caches are invalidated properly. For example, for Sass I believe that either the caches will not differ between environments, or Sass will know that it is invoked differently and invalidate the caches.
I’ll close this for now, as I don’t believe this will be a problem. I added a spec in e1c9cdd that tests the behavior of Sass and caching with environments.
@bburton said in #859:
I see two action points here:
The text was updated successfully, but these errors were encountered: