0
votes

ALL of my CSS, fonts, js files are respectively in web/css/, web/fonts/ and web/js/.

Some css files import/include fonts or CSS files using relative paths:

@font-face {
    font-family: 'et-line';
    src:url('../fonts/et-line.eot');
    src:url('../fonts/et-line.eot?#iefix') format('embedded-opentype'),
        url('../fonts/et-line.woff') format('woff'),
        url('../fonts/et-line.ttf') format('truetype'),
        url('../fonts/et-line.svg#et-line') format('svg');
    font-weight: normal;
    font-style: normal;
}

@import url("slider.css");
@import url("vertical.css");

Naturally, since I'm using assetic, I simply add the cssrewrite filter inthe following code to correctly include my files:

{% stylesheets filter="cssrewrite"
    'css/simpletextrotator.css'
    'css/font-awesome.min.css'
    'css/et-line-font.css'
    'css/magnific-popup.css'
    'css/flexslider.css'
    'css/animate.css'
    'css/style.css'
    'css/custom.css'
%}

    <link rel="stylesheet" href="{{ asset_url }}" type="text/css" />

{% endstylesheets %}

I clean the cache in both environments, use these commands:

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

Everything works perfectly in the dev environment, but in the prod one, the exact files I imported earlier (using @font-face and @import) aren't included. Using the debugger and the console, I can see that:

Firebug's console

Assetic provided paths that aren't correct, Symfony looks for these folder in the root folder while it should look in the web/ folder.

What can I do?

1

1 Answers

0
votes

You must clear caché in order by it works on prod environments with these command:

php app/console cache:clear --env=prod