heroku

Dependencies

Syntax#

  • “dependencies”: { …

}

Bower dependancy

To automatically install bower and its components, one must

  1. Specify the bower dependency in package.json:

    "dependencies": {
        "bower": "^1.7.9"
    }
  2. Use scripts to execute a postinstall command

    "scripts": {
        "postinstall": "./node_modules/bower/bin/bower install"
    }
  3. Create a .bowerrc file to set the directory for bower_components to install. Otherwise bower_components are installed in root directory.

    {
        "directory" : "app/bower_components"
    }

Now, Heroku automatically executes bower install command after npm install


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow