Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cookbook][Assetic][Apply filter] Added node_paths /usr/lib/node_modules REQUIRED #2775

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions cookbook/assetic/apply_to_option.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ as you'll see here, files that have a specific extension. To show you how
to handle each option, let's suppose that you want to use Assetic's CoffeeScript
filter, which compiles CoffeeScript files into Javascript.

The main configuration is just the paths to coffee and node. These default
respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
The main configuration is just the paths to coffee, node and node_modules. These default
respectively to ``/usr/bin/coffee``, ``/usr/bin/node`` and ``/usr/lib/node_modules``:

.. configuration-block::

Expand All @@ -22,15 +22,18 @@ respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
coffee:
bin: /usr/bin/coffee
node: /usr/bin/node
node_paths: [ /usr/lib/node_modules/ ]

.. code-block:: xml

<!-- app/config/config.xml -->
<assetic:config>
<assetic:filter
<assetic:filter
name="coffee"
bin="/usr/bin/coffee"
node="/usr/bin/node" />
bin="/usr/bin/coffee/"
node="/usr/bin/node/">
<assetic:node-paths>/usr/lib/node_modules/</assetic:node-path>
</assetic:filter>
</assetic:config>

.. code-block:: php
Expand All @@ -41,6 +44,7 @@ respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
'coffee' => array(
'bin' => '/usr/bin/coffee',
'node' => '/usr/bin/node',
'node_paths' => array('/usr/lib/node_modules/'),
),
),
));
Expand Down Expand Up @@ -128,6 +132,7 @@ applied to all ``.coffee`` files:
coffee:
bin: /usr/bin/coffee
node: /usr/bin/node
node_paths: [ /usr/lib/node_modules/ ]
apply_to: "\.coffee$"

.. code-block:: xml
Expand All @@ -139,8 +144,9 @@ applied to all ``.coffee`` files:
bin="/usr/bin/coffee"
node="/usr/bin/node"
apply_to="\.coffee$" />
<assetic:node-paths>/usr/lib/node_modules/</assetic:node-path>
</assetic:config>

.. code-block:: php

// app/config/config.php
Expand All @@ -149,6 +155,7 @@ applied to all ``.coffee`` files:
'coffee' => array(
'bin' => '/usr/bin/coffee',
'node' => '/usr/bin/node',
'node_paths' => array('/usr/lib/node_modules/'),
'apply_to' => '\.coffee$',
),
),
Expand Down