Skip to content

Commit

Permalink
feature #5294 Tweaks to bower entry - specifically committing deps (w…
Browse files Browse the repository at this point in the history
…eaverryan)

This PR was merged into the 2.3 branch.

Discussion
----------

Tweaks to bower entry - specifically committing deps

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets | n/a

This follows after #5159. The biggest addition is a short conversation about committing Bower assets.

Thanks!

Commits
-------

7f4b55e Many tweaks thanks to the team!
d526765 Small tweaks, but mostly adding a section about committing Bower assets
  • Loading branch information
weaverryan committed May 23, 2015
2 parents 69c94d8 + 7f4b55e commit 5922f50
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion cookbook/frontend/bower.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ then run:
$ npm install -g bower
After this command succeeded, run ``bower`` in your terminal to find out if
After this command has finished, run ``bower`` in your terminal to find out if
it's installed correctly.

.. tip::
Expand All @@ -43,6 +43,12 @@ create a ``.bowerrc`` file with a new destination (like ``web/assets/vendor``):
"directory": "web/assets/vendor/"
}
.. tip::

If you're using a front-end build system like `Gulp`_ or `Grunt`_, then
you can set the directory to whatever you want. Typically, you'll use
these tools to ultimately move all assets into the ``web/`` directory.

An Example: Installing Bootstrap
--------------------------------

Expand Down Expand Up @@ -110,8 +116,31 @@ template like normal CSS/JS:
Great job! Your site is now using Bootstrap. You can now easily upgrade
bootstrap to the latest version and manage other front-end dependencies too.

Should I Git Ignore or Commit Bower Assets?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Currently, you should probably *commit* the assets downloaded by Bower instead
of adding the directory (e.g. ``web/assets/vendor``) to your ``.gitignore``
file:

.. code-block:: bash
$ git add web/assets/vendor
Why? Unlike Composer, Bower currently does not have a "lock" feature, which
means that there's no guarantee that running ``bower install`` on a different
server will give you the *exact* assets that you have on other machines.
For more details, read the article `Checking in front-end dependencies`_.

But, it's very possible that Bower will add a lock feature in the future
(e.g. `bower/bower#1748`_).

.. _Bower: http://bower.io
.. _`Node.js`: https://nodejs.org
.. _BowerPHP: http://bowerphp.org/
.. _`Bower documentation`: http://bower.io/
.. _Bootstrap: http://getbootstrap.com/
.. _Gulp: http://gulpjs.com/
.. _Grunt: http://gruntjs.com/
.. _`Checking in front-end dependencies`: http://addyosmani.com/blog/checking-in-front-end-dependencies/
.. _`bower/bower#1748`: https://github.com/bower/bower/pull/1748

0 comments on commit 5922f50

Please sign in to comment.