Skip to content

Commit 5922f50

Browse files
committed
feature #5294 Tweaks to bower entry - specifically committing deps (weaverryan)
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
2 parents 69c94d8 + 7f4b55e commit 5922f50

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

cookbook/frontend/bower.rst

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ then run:
1919
2020
$ npm install -g bower
2121
22-
After this command succeeded, run ``bower`` in your terminal to find out if
22+
After this command has finished, run ``bower`` in your terminal to find out if
2323
it's installed correctly.
2424

2525
.. tip::
@@ -43,6 +43,12 @@ create a ``.bowerrc`` file with a new destination (like ``web/assets/vendor``):
4343
"directory": "web/assets/vendor/"
4444
}
4545
46+
.. tip::
47+
48+
If you're using a front-end build system like `Gulp`_ or `Grunt`_, then
49+
you can set the directory to whatever you want. Typically, you'll use
50+
these tools to ultimately move all assets into the ``web/`` directory.
51+
4652
An Example: Installing Bootstrap
4753
--------------------------------
4854

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

119+
Should I Git Ignore or Commit Bower Assets?
120+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121+
122+
Currently, you should probably *commit* the assets downloaded by Bower instead
123+
of adding the directory (e.g. ``web/assets/vendor``) to your ``.gitignore``
124+
file:
125+
126+
.. code-block:: bash
127+
128+
$ git add web/assets/vendor
129+
130+
Why? Unlike Composer, Bower currently does not have a "lock" feature, which
131+
means that there's no guarantee that running ``bower install`` on a different
132+
server will give you the *exact* assets that you have on other machines.
133+
For more details, read the article `Checking in front-end dependencies`_.
134+
135+
But, it's very possible that Bower will add a lock feature in the future
136+
(e.g. `bower/bower#1748`_).
137+
113138
.. _Bower: http://bower.io
114139
.. _`Node.js`: https://nodejs.org
115140
.. _BowerPHP: http://bowerphp.org/
116141
.. _`Bower documentation`: http://bower.io/
117142
.. _Bootstrap: http://getbootstrap.com/
143+
.. _Gulp: http://gulpjs.com/
144+
.. _Grunt: http://gruntjs.com/
145+
.. _`Checking in front-end dependencies`: http://addyosmani.com/blog/checking-in-front-end-dependencies/
146+
.. _`bower/bower#1748`: https://github.com/bower/bower/pull/1748

0 commit comments

Comments
 (0)