How can I invoke npm on heroku command line (to install bower components)?

后端 未结 4 2151
清酒与你
清酒与你 2020-12-13 04:33

Bower is for client side Javascript what npm is for the server side and reads a component.json file to recognize dependencies that should be fetched at deploy t

4条回答
  •  孤街浪徒
    2020-12-13 05:18

    You can also setup a postintall command, something like this in your package.json

    "dependencies": {
        "bower": "0.6.x"
    },
    "scripts": {
        "postinstall": "./node_modules/bower/bin/bower install"
    }
    

    Then npm install will also install bower dependencies.

    Pros : one command to rule them all.

    Cons : you unnecessarily embed bower as a dependency.

提交回复
热议问题