assetic compass filter, css not updating when changing imported file

Showing 1-4 of 5 messages
assetic compass filter, css not updating when changing imported file Steve 3/14/12 9:27 AM
Hi,

Im using the compass filter in assetic to compile my scss files into css.  

Im including other scss files using the @import command, if I update an imported file without changing the parent file then the parent file doesnt get recompiled (im using the dev environment).  Is there a cache setting that I need to change?

For example say the file main.scss contains @import "coolstuff.scss".  If I modify coolstuff.scss then main.scss is not being refreshed.

The assetic bit of my config_dev.yml is:

parameters:
    # Assetic
    assetic.filter.compass.images_dir: %kernel.root_dir%/../web/images
    assetic.filter.compass.http_path:  /images


assetic:
    debug:          %kernel.debug%
    use_controller: true
    sass: "/path/to/sass"
    filters:
        cssrewrite: ~
        compass:
            bin: "/path/to/compass"

Thanks for any help,
Steve

Re: assetic compass filter, css not updating when changing imported file Steve 3/15/12 4:34 AM
Ive had a look at the Assetic code and think Ive found a work around, however it seems like a hack.

In the AsseticController.php (vendor/bundles/Symfony/Bundle/AsseticBundle/Controller/AsseticController.php).  Ive disabled what I think is the cache for assetic assets.  I guess there must be a more elegant way to disable the cache for compass filtered files so if anyone could advise me Id really appreciate it.

The output of git diff for AsseticController.php is below indicating my changes:

diff --git a/Controller/AsseticController.php b/Controller/AsseticController.php
index c97403a..6370501 100644
--- a/Controller/AsseticController.php
+++ b/Controller/AsseticController.php
@@ -40,10 +40,12 @@ class AsseticController
         $this->cache = $cache;
         $this->enableProfiler = (boolean) $enableProfiler;
         $this->profiler = $profiler;
+
     }
 
     public function render($name, $pos = null)
     {
+
         if (!$this->enableProfiler && null !== $this->profiler) {
             $this->profiler->disable();
         }
@@ -74,10 +76,11 @@ class AsseticController
         }
 
         if ($response->isNotModified($this->request)) {
-            return $response;
+          //return $response;
         }
 
-        $response->setContent($this->cachifyAsset($asset)->dump());
+        //$response->setContent($this->cachifyAsset($asset)->dump());
+        $response->setContent($asset->dump());
 
         return $response;
Re: assetic compass filter, css not updating when changing imported file Jack Fuchs 7/18/13 2:18 AM
I guess it's an issue with the LazyAssetManager->getLastModified() method.. It should recognize and consider the childrens (imports) modification dates..
Re: assetic compass filter, css not updating when changing imported file Jack Fuchs 7/18/13 2:33 AM
Yes, and that's it. I broke it down to the CompassFilter.php...

public function getChildren(AssetFactory $factory, $content, $loadPath = null)
{
    // todo
    return array();
}

Can't work...