Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d85358

Browse files
committed
[Cookbook][Assetic] Apply to option
I proposed this patch for branch 2.2 and is already patched f148324, please apply to branch 2.3 and master I was testing, testing and testing one and another method or posibility, until I reached that page: kriswallsmith/assetic#185 that opened my eyes, and one value was missing: node_paths /usr/lib/node_modules I continously received: [exception] 500 | Internal Server Error | Assetic\Exception\FilterException [message] An error occurred while running: '/usr/bin/node' '/tmp/assetic_styluswWvcnS' Error Output: module.js:340 throw err; ^ Error: Cannot find module 'stylus' so, this fixes and finishes my 6 hours quest.
1 parent 7038693 commit 0d85358

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cookbook/assetic/apply_to_option.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ as you'll see here, files that have a specific extension. To show you how
99
to handle each option, let's suppose that you want to use Assetic's CoffeeScript
1010
filter, which compiles CoffeeScript files into Javascript.
1111

12-
The main configuration is just the paths to coffee and node. These default
13-
respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
12+
The main configuration is just the paths to coffee, node and node_modules.
13+
An example configuration might look like this:
1414

1515
.. configuration-block::
1616

@@ -22,6 +22,7 @@ respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
2222
coffee:
2323
bin: /usr/bin/coffee
2424
node: /usr/bin/node
25+
node_paths: [ /usr/lib/node_modules ]
2526
2627
.. code-block:: xml
2728
@@ -30,7 +31,9 @@ respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
3031
<assetic:filter
3132
name="coffee"
3233
bin="/usr/bin/coffee"
33-
node="/usr/bin/node" />
34+
node="/usr/bin/node">
35+
<assetic:node-path>/usr/lib/node_modules</assetic:node-path>
36+
</assetic:filter>
3437
</assetic:config>
3538
3639
.. code-block:: php
@@ -41,6 +44,7 @@ respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
4144
'coffee' => array(
4245
'bin' => '/usr/bin/coffee',
4346
'node' => '/usr/bin/node',
47+
'node_paths' => array('/usr/lib/node_modules'),
4448
),
4549
),
4650
));
@@ -128,6 +132,7 @@ applied to all ``.coffee`` files:
128132
coffee:
129133
bin: /usr/bin/coffee
130134
node: /usr/bin/node
135+
node_paths: [ /usr/lib/node_modules ]
131136
apply_to: "\.coffee$"
132137
133138
.. code-block:: xml
@@ -139,6 +144,7 @@ applied to all ``.coffee`` files:
139144
bin="/usr/bin/coffee"
140145
node="/usr/bin/node"
141146
apply_to="\.coffee$" />
147+
<assetic:node-path>/usr/lib/node_modules</assetic:node-path>
142148
</assetic:config>
143149
144150
.. code-block:: php
@@ -149,6 +155,7 @@ applied to all ``.coffee`` files:
149155
'coffee' => array(
150156
'bin' => '/usr/bin/coffee',
151157
'node' => '/usr/bin/node',
158+
'node_paths' => array('/usr/lib/node_modules'),
152159
'apply_to' => '\.coffee$',
153160
),
154161
),

0 commit comments

Comments
 (0)