kriswallsmith / assetic

Asset Management for PHP
MIT License
3.75k stars 559 forks source link

Cannot disable asset combination in debug mode #429

Open matdev opened 11 years ago

matdev commented 11 years ago

Hello,

I would like to disable asset combination when I am debugging.

I have tried setting "combine=false" in my assetic call. But when using firebug, I still see the css coming from a combined css file.

Is there a way to completely disable asset combination from the assetic configuration section in the config_dev file ?

stof commented 11 years ago

In debug mode, the default behavior is to send assets separately. Can you show your assetic call and the generated HTML ?

matdev commented 11 years ago

Sure. Here is my assetic call:

{% stylesheets filter='lessphp,cssrewrite'
     '@DevoptionBaseBundle/Resources/less/front.less'
     '@DevoptionBaseBundle/Resources/less/back.less'
'@DevoptionBaseBundle/Resources/public/css/custom-theme/jquery-ui-1.10.0.custom.css'
'@DevoptionBaseBundle/Resources/public/css/jquery.mCustomScrollbar.css'
     output='css/style4.css'
     %}
     <link href="{{ asset_url }}" type="text/css" rel="stylesheet" />

... and the html generated:

<link  href="/css/style4.css  <view-source:http://www.departgolf.com/css/style4.css>"type="text/css"rel="stylesheet"/>

And here is config.yml:

assetic:
     debug:          false #"%kernel.debug%"
     use_controller: false
     #bundles:        [ ]
     #java: /usr/bin/java
     filters:
         cssrewrite: ~
         cssembed:
             jar: %kernel.root_dir%/Resources/java/cssembed-0.4.5.jar
         lessphp:
             file: %kernel.root_dir%/../vendor/lessphp/lessc.inc.php
             apply_to: "\.less$"

And in config_dev.yml:

assetic:
     use_controller: true

Mathias

stof commented 11 years ago

the issue is simple: you are not in debug mode as you are forcing it to false

matdev commented 11 years ago

Indeed... but when I add the following line to my config_dev.yml file:

debug: true

the asset files are still combined. Is there anything else wrong in my assetic config ?

dominikzogg commented 10 years ago

@stof it seems, i got the same problem, the factory returns true $factory->isDebug(), but i get only 1 output file. Its called like output='....' or choice a name for combine if i remove it. The template render the urls splitted (as it should be)

dominikzogg commented 10 years ago

get the same output if i turn debugging on : https://github.com/saxulum/saxulum-assetic-twig-provider/blob/master/tests/Saxulum/Tests/AsseticTwig/Silex/Provider/AsseticTwigProviderTest.php#L77

same if i add many files (https://github.com/dominikzogg/evepvp/blob/master/src/Dominikzogg/Evepvp/Resources/views/layout.html.twig)

the output is css/libraries.css with and without debugging

dominikzogg commented 10 years ago

get it, seems toe write assets must be checked manually: https://github.com/saxulum/saxulum-assetic-twig-provider/blob/master/src/Saxulum/AsseticTwig/Assetic/Helper/Dumper.php#L56