在我的package.json脚本中,我有这个
"typeorm": "ts-node ./node_modules/typeorm/cli.js"
我希望能够从cli用法扩展这个脚本,例如
npm run typeorm migration:create -n Example
但当我在终端中这样运行它时,它就会被执行:
ts-node ./node_modules/typeorm/cli.js "migrations:create" "Example"
注意,npm正在删除标志-n你知道我该如何运行这样的脚本并保留标志和一切吗?谢谢。
好的,我找到了答案。。。只需添加——在npm运行typeorm 之后
示例:
npm run typeorm -- migration:create -n Example
之后的所有内容都将根据文档直接添加到脚本中