0
votes

In one of my Symfony projects I am using assetic for asset managment. All my twig files extend a base file called base.html.twig. I This file (base) I have:

{% stylesheets output="css/compiled/main.css" filter='cssrewrite'
            '../vendor/bootstrap/css/bootstrap.css'
            'css/general.css'
            'css/navigation.css'
        %}
            <link rel="stylesheet" href="{{ asset_url }}" />
        {% endstylesheets %}
{% endblock %}

In the other files that extend the base file I override the stylesheets block so that I can add other css files. This is what I do:

{% block stylesheets %}
    {{ parent() }}
    {% stylesheets output="css/compiled/main.css" filter='cssrewrite'
        'bundles/account/css/signup.css'
     %}
        <link rel="stylesheet" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}

Now the problem is that signup.css is never added in main.css and so are all the other files that are not in the stylesheet block in the base file.

I don't know why but this started happening when I swtiched to prod environment (it was working fine in dev). I've done, as recommending on Symfony's website:

php app/console assetic:dump --env=prod --no-debug

One other thing, it seems that I can't swtich back to dev mode even when I'm using app_dev.php

Do you guys have any idea of where these errors could come from ?

Thank you in advance for you help,

kimimsc

1
I'm afraid that what you want is not possible. A few days ago I tried to solve the same issue but as several SO questions (or answers) mention, assetic can't do this. See stackoverflow.com/questions/6958970/… e.g.SirDerpington

1 Answers

0
votes

Your have a conflict with your 'option' attribute. So in prod environnement, the second stylesheet overwrite the first.

You must use another output value for signup.css (or don't use this option)