-1
每當我運行npm install時,它都會運行npm run postinstall。我如何添加一個自定義的安裝後腳本?這樣在運行npm之後安裝它運行npm run postinstall2?如何添加自定義的NPM安裝後腳本?
每當我運行npm install時,它都會運行npm run postinstall。我如何添加一個自定義的安裝後腳本?這樣在運行npm之後安裝它運行npm run postinstall2?如何添加自定義的NPM安裝後腳本?
你用&&
鏈接叫他們從postinstall
多個腳本:
{
"scripts": {
"script1": "",
"script2": "",
"postinstall": "script1 && script2"
}
}
這應該在Windows和Unix(Linux的,MacOS的)終端都正常工作。
不,我的意思是我們如何讓npm install完成後調用腳本以外的腳本。 – Jasmine
@Jasmine有什麼意義?只要將其他腳本中的任何內容放到''postinstall''中;或者如果你真的關心了,那麼''postinstall':「npm run postinstall2」'但是沒有意義。 –