How to update bower.json with installed packages?

后端 未结 6 1105
遇见更好的自我
遇见更好的自我 2021-01-29 22:28

In my project I\'ve installed bower components without save option. Now, I would like update to bower.json?

How can I update b

6条回答
  •  长情又很酷
    2021-01-29 23:19

    A little trick if you don't want to write a script for that:

    before doing anything rename your bower.json in bower2.json for example.

    then you can do a:

    $ bower init

    (automatically create a bower.json file).

    note that all questions should be pre-filled with your current config.

    When it will ask you:

    set currently installed components as dependencies? say yes,

    You now have all your dependencies in the new bower.json file (and you can check if everything is right with the old bower2.json)

提交回复
热议问题