Leantraxxx
Leantraxxx

Reputation: 4596

Change package name with bower

I want to install two versions of the same package on my components directory.

On command line I can do something like:

bower install <name>=<package>#<version>

For example:

bower install bootstrap-new=bootstrap#2.3.2
bower install bootstrap-old=bootstrap#2.0.2

Having this .bowerrc file...

{
  "directory": "vendor/assets/components",
  "json": "bower.json"
}

I can see 2 directories:

  1. vendor/assets/components/bootstrap-new
  2. vendor/assets/components/bootstrap-old

The question is: How can I do the same thing using the bower.json file?

Upvotes: 2

Views: 827

Answers (1)

Sindre Sorhus
Sindre Sorhus

Reputation: 63487

Use the --save flag bower install --save bootstrap-new=bootstrap#2.3.2 and you should end up with this in your bower.json:

"dependencies": {
  "bootstrap-new": "bootstrap#2.3.2"
}

Upvotes: 4

Related Questions