I use assetic with less in Symfony 2 and MopaBootstrapBundle.
The dynamically generated css file seems valid, but the style is not applied. If we dump assets, then it works in prod, but I do not want to do it in dev as it is against everything that I thought.
config.yml
assetic: debug: %kernel.debug% use_controller: false bundles: [ MopaBootstrapBundle ] #java: /usr/bin/java filters: cssrewrite: ~ less: node: /usr/local/bin/node node_paths: [/usr/local/lib/node_modules] # auto apply less to all .less files apply_to: "\.less$"
config_dev.yml
assetic: use_controller: true
inside my template:
{% stylesheets '@MopaBootstrapBundle/Resources/public/less/mopabootstrapbundle.less' %} <link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
displayed html:
<link href="/app_dev.php/css/bab9907_mopabootstrapbundle_1.css" type="text/css" rel="stylesheet" media="screen" />
This file permits, I can paste the URL into the address bar and see the actual CSS file.
In addition, if we dump assets in prod, it also works
app/console assetic:dump --env=prod
We clear the prod cache, and the output is in style. In dev, I get a null style.
I also ran:
app/console assets:install --symlink web Installing assets using the symlink option Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework Installing assets for Mopa\Bundle\BootstrapBundle into web/bundles/mopabootstrap Installing assets for Symfony\Bundle\WebProfilerBundle into web/bundles/webprofiler Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
None of this is Javascript (files are resolved using URLs)
Am I doing something wrong?