php - How can I use Autoprefixer with Symfony2 -
i'm trying integrate autoprefixer in symfony2 (with assetic) workflow. first thought assetic provided support filter (like uglifycss , others), tried this:
{% stylesheets '@privatebundle/resources/public/less/bootstrap/bootstrap.less' '@privatebundle/resources/public/less/private.less' filter='less,cssrewrite,autoprefixer,?uglifycss' %} <link rel="stylesheet" href="{{ asset_url }}"> {% endstylesheets %}
but didn't work.
the alternative find netzmacht/assetic-autoprefixer, couldn't make work either.
i installed autoprefixer globally (via sudo npm install -g autoprefixer
), , installed kriswallsmith/assetic (which guess different assetic supports autoprefixer) via composer, after not find binary need parameters.yml
file.
i read on github issue autoprefixer may have changed several times since assetic-autoprefixer last updated, can't find thread now. there weren't further comments anyway.
is there i'm missing or doing wrong? there other ways use autoprefixer (or other similar tool) symfony , assetic?
i found solution. seems autoprefixer
no longer standalone tool, plugin other tools, way in assetic-autoprefixer
trying use (with binary) isn't valid anymore.
so instead of autoprefixer
, solution installing autoprefixer-cli
, unofficial binary addresses "legacy" code.
sudo npm install autoprefixer-cli --save
and pointing binary in parameters.yml
. in case:
assetic: autoprefixer: bin: %kernel.root_dir%/../node_modules/autoprefixer-cli/autoprefixer-cli
Comments
Post a Comment