Created
September 10, 2012 20:21
-
-
Save marzocchi/3693582 to your computer and use it in GitHub Desktop.
Configure Assetic's LessFilter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample configuration for overriding Assetic's default LessFilter | |
# configuration in order to define one or more "load paths". | |
# | |
# Setting load paths allows to load libraries (such as Twitter's Bootstrap | |
# less sources) from different directories. | |
# | |
# Save this file in your bundle's `config` directory and import it into | |
# yor `services.yml` using the `imports` directive, eg.: | |
# | |
# imports: | |
# - { resource: assetic-less.yml } | |
# | |
# Link the stylesheets in your templates with: | |
# | |
# {% stylesheets '@FooBundle/Resources/public/css/*' | |
# filter="less" %} | |
# | |
# <link rel="stylesheet" href="{{ asset_url }}" type="text/css" /> | |
# | |
# {% endstylesheets %} | |
# | |
parameters: | |
# Set to true to enable compression of the generated CSS. | |
less.compress: false | |
# Node executable's location. | |
less.node_bin: /usr/local/bin/node | |
# Node modules location (eg.: directory where npm installed "less", | |
# you'll find a "less" directory in there). | |
less.node_module_dir: /usr/local/lib/node_modules | |
# Where to look for "@imported" files. | |
# | |
# The following: | |
# | |
# @import "bootstrap.less" | |
# | |
# Will result in a "bootstrap.less" file being searched in the | |
# configured directory (after the default one, which is the | |
# directory contaning the asset being parsed). | |
less.bootstrap_less_sources: /Users/marzocchi/Desktop/lab/bootstrap/less | |
services: | |
foo.assetic.filter.less: | |
class: "Assetic\\Filter\\LessFilter" | |
arguments: | |
- %less.node_bin% | |
- [ %less.node_module_dir% ] | |
calls: | |
- [ addLoadPath, [ %less.bootstrap_less_sources% ] ] | |
- [ setCompress, [ %less.compress% ] ] | |
tags: | |
# Tag this service as an "assetic.filter", and give it the "less" alias | |
# to override the builtin "less" filter. | |
- { name: "assetic.filter", alias: "less" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment