【问题标题】:Run/start both test and app with one command使用一个命令运行/启动测试和应用程序
【发布时间】:2019-03-30 15:22:02
【问题描述】:

目前我在package.json中有这两个脚本命令:

"dev": "react-scripts start",
"test": "react-scripts test",

有没有一种方法可以用一个命令同时运行这两个?

【问题讨论】:

    标签: node.js reactjs create-react-app


    【解决方案1】:

    在 package.json 脚本部分定义"run:all": "npm run dev & npm run test",然后运行npm run:all

    && 会让你第二个命令等到第一个被执行。 & 不会等待,会并行启动

    【讨论】:

    • 是的,"all": "yarn test & yarn dev" 做到了。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-04
    • 2018-10-26
    • 1970-01-01
    相关资源
    最近更新 更多