1

I'm using Bower whereby I run bower install and it downloads dependency files to /bower_components directory. Then, I create symlinks from my /public/.. directories to the dist files:

mypc:/var/www/myproject/public/js$ ls -l
total 8
lrwxrwxrwx 1 tom tom   67 Dec 23 07:29 bootstrap.min.js -> /var/www/myproject/bower_components/bootstrap/dist/js/bootstrap.min.js
lrwxrwxrwx 1 tom tom   58 Dec 23 07:29 jquery.min.js -> /var/www/myproject/bower_components/jquery/dist/jquery.min.js

Is this the way that Bower is typically used? I'm trying to find a way to automate the process, the best I've thought is to exec a install.sh after installation but was wondering if this can be done with Bower. Is there a better/preferred way?

I thought against putting the bower_components in the public directory too as there are lots of files that don't need to be there (e.g. README, src, etc). In most cases I only require one or two files from each.

2
  • Are you using a build tool like grunt/gulp/etc, or other tools like a concatenor/minifier? Jun 6, 2015 at 21:51
  • Yeh I use Grunt also, .. good point. I guess I'd be configuring in there to minify, concat etc huh, no need to symlink. I should have probably spent a little more time with it, I'd have figured that out soon enough. At the moment, most of our JS/CSS libraries are retrieved from CDNs.
    – Martyn
    Jun 9, 2015 at 5:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.