背景和实操

比如在ReactNative中,安装完依赖之后,需要改端口、删掉某些文件….

多个操作不能在package.json中定义数组,但可以重新定义一个脚本,在脚本中定义操作集合:

shell中这么写就行

#!/bin/bash

echo 'Now run custom commands after all package is installed.'

echo 'modify react-native package-manager default port'
react-native-port-patcher --new-port 9090

echo 'fix `Font Awesome` could not be found within the package etc.'
rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json