Romain Linsolas
Romain Linsolas

Reputation: 81617

How to specify the target directory for bower-install?

In my index.html file, I've added that:

    <!-- bower:js -->
    <!-- endbower -->

in order to let install-bower grunt task to put all my Bower dependencies. In my Gruntfile.js, I have the following task:

    'bower-install': {
        dist: {
            html: 'cwf/index.html'
        }
    }

At the end, in my index.html, I get something like:

    <!-- bower:js -->
    <script src="bower_components/jquery/jquery.js"></script>
    <script src="bower_components/angular/angular.js"></script>
    ...
    <!-- endbower -->

However, I want to configure the task to prepend ../ before the bower_components, so to get that:

    <!-- bower:js -->
    <script src="../bower_components/jquery/jquery.js"></script>
    <script src="../bower_components/angular/angular.js"></script>
    ...
    <!-- endbower -->

How can I configure the task for that purpose?

Upvotes: 0

Views: 3639

Answers (1)

Konstantin Krass
Konstantin Krass

Reputation: 8646

create a file named: .bowerrc within the where your bower.json is located at. That's how you can configure your bower.

Add the property directory, to specify the download path for the components.

Content of the .bowerrc

{
  "directory": "../yourCustomPath/"
}

Upvotes: 5

Related Questions