Skip to content

Instantly share code, notes, and snippets.

@s2t2
Last active September 26, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s2t2/73629213fcf250081627 to your computer and use it in GitHub Desktop.
Save s2t2/73629213fcf250081627 to your computer and use it in GitHub Desktop.
example npm and bower usage from a rails app

Install front-end dependencies specified by bower.json.

bower install

On production, instead of running bower install, run npm install, which should install bower and other dependencies specified in package.json.

config.assets.paths << Rails.root.join('vendor', 'assets', 'components')
{
"name": "debate-watch",
"dependencies":{
"bootstrap": "~3.3.4",
"d3": "~3.5.5",
"jquery": "~2.1.4",
"jqueryui": "~1.11.4",
"octicons": "*"
}
}
{
"name": "debate-watch",
"version": "0.0.1",
"dependencies": {
"bower": "~1.4"
},
"engine": {
"node": "0.12.7",
"npm": "2.12.1"
},
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment