Skip to content

Instantly share code, notes, and snippets.

@yano3nora
Last active May 14, 2023 00:17
Show Gist options
  • Save yano3nora/e14d1fa042f8ff32d22c88c8bba1715b to your computer and use it in GitHub Desktop.
Save yano3nora/e14d1fa042f8ff32d22c88c8bba1715b to your computer and use it in GitHub Desktop.
[js: npm-run-all] A CLI tool to run multiple npm-scripts in parallel or sequential. #js

Overview

mysticatea/npm-run-all

npm scripts を複数、並列または直列実行するためのツール。

$ npm i -D npm-run-all

# npx での実行はちょっとイレギュラーな書き方する
#
# npx run-s のように実行できない issue がある
# ↑ やると [email protected] とかいう別物走らせようとするので注意
# https://github.com/mysticatea/npm-run-all/issues/209
#
$ npm exec -- run-s test:*
{
  "scripts": {
    // run-s で直列実行
    "check": "run-s check:**",
    "check:type": "tsc --noEmit",
    "check:lint": "eslint . --ext .js,.jsx,.ts,.tsx",
    // run-p で並列実行
    "start": "run-p -r dev:**",
    "dev:vite": "vite --https --host",
    "dev:firebase": "firebase emulators:start",
  },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment