Question

I am trying to do this in my .bowerrc file

"directory": "~/bower_components"

which I want is to resolve to the current users home folder:

/home/me/bower_components

but currently it is being resolved to:

[currentDirectory]/~/bower_components

Is their a way to get it to point to an absolute path?

Was it helpful?

Solution

The field you need to set in the .bowerrc is cwd to give your installs an absolute root.

For example, the .bowerrc file:

{
  'cwd': '/var/www/libraries',
  'directory': 'vendor'
}

will result in all your bower update/install commands to place packages in /var/www/libraries/vendor.

I experimented with using ~ for the cwd parameter, and Bower didn't understand it.

The documentation for what Bower expects to find in .bowerrc is in this Google doc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top