`.
.. tip::
- Instead of adding the filter to the asset tags, you can also globally
- enable it by adding the ``apply_to`` attribute to the filter configuration, for
- example in the ``uglifyjs2`` filter ``apply_to: "\.js$"``. To only have
- the filter applied in production, add this to the ``config_prod`` file
- rather than the common config file. For details on applying filters by
- file extension, see :ref:`cookbook-assetic-apply-to`.
+ Instead of adding the filters to the asset tags, you can also configure which
+ filters to apply for each file in your application configuration file.
+ See :ref:`cookbook-assetic-apply-to` for more details.
Install, Configure and Use UglifyCSS
------------------------------------
@@ -231,8 +232,14 @@ the node package is installed:
.. code-block:: bash
+ # global installation
$ npm install -g uglifycss
+ # local installation
+ $ cd /path/to/your/symfony/project
+ $ mkdir app/Resources/node_modules
+ $ npm install uglifycss --prefix app/Resources
+
Next, add the configuration for this filter:
.. configuration-block::
diff --git a/cookbook/assetic/yuicompressor.rst b/cookbook/assetic/yuicompressor.rst
index 356b67b6071..dccb8351a56 100644
--- a/cookbook/assetic/yuicompressor.rst
+++ b/cookbook/assetic/yuicompressor.rst
@@ -4,19 +4,15 @@
How to Minify JavaScripts and Stylesheets with YUI Compressor
=============================================================
-Yahoo! provides an excellent utility for minifying JavaScripts and stylesheets
-so they travel over the wire faster, the `YUI Compressor`_. Thanks to Assetic,
-you can take advantage of this tool very easily.
-
.. caution::
- The YUI Compressor is `no longer maintained by Yahoo`_ but by an independent
- volunteer. Moreover, Yahoo has decided to `stop all new development on YUI`_
- and to move to other modern alternatives such as Node.js.
+ The YUI Compressor is `no longer maintained by Yahoo`_. That's why you are
+ **strongly advised to avoid using YUI utilities** unless strictly necessary.
+ Read :doc:`/cookbook/assetic/uglifyjs` for a modern and up-to-date alternative.
- That's why you are **strongly advised** to avoid using YUI utilities unless
- strictly necessary. Read :doc:`/cookbook/assetic/uglifyjs` for a modern and
- up-to-date alternative.
+Yahoo! provides an excellent utility for minifying JavaScripts and stylesheets
+so they travel over the wire faster, the `YUI Compressor`_. Thanks to Assetic,
+you can take advantage of this tool very easily.
Download the YUI Compressor JAR
-------------------------------
@@ -170,4 +166,3 @@ apply this filter when debug mode is off.
.. _`YUI Compressor`: http://developer.yahoo.com/yui/compressor/
.. _`Download the JAR`: https://github.com/yui/yuicompressor/releases
.. _`no longer maintained by Yahoo`: http://www.yuiblog.com/blog/2013/01/24/yui-compressor-has-a-new-owner/
-.. _`stop all new development on YUI`: http://yahooeng.tumblr.com/post/96098168666/important-announcement-regarding-yui
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy