Domanda

I'm using assetic within Symfony2 to load all of my assets, and I'm also using the compass filter. All my code is now out of development so I need to compress it if possible. I've looked into the uglifyCSS filters but I don't and probably can't install Node on my server.

Is there a way to make Symfony2 use the Sass --style :compressed functionality so my code is minified when i generate assets?

È stato utile?

Soluzione

Some time ago I had the same problem. It is quite easy to overcome, but there is nothing mentioned in the documentation. This is how you do it:

// in config.yml
assetic:
    filters:
        scss:
            style: compressed

This will pass --style argument to sass with the value compressed.

Altri suggerimenti

In you production configuration file you can set :

assetic:
    filters:
        compass:
            # ...
            style: compressed

I use compass to generate the css files directly (using the compass watch command) and have those dumped to the public folder. In compass, you can change the output_style to one of these 4 - :expanded, :nested, :compact or :compressed. Using compressed is the one you would want.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top