Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- component
- 리액트
- NPM
- MongoDB
- mongoose
- 클래스컴포넌트
- 리액트스타디
- sementicversion
- React
- React Component
- nodeJS
- 시퀄라이즈공부
- node
- 시퀄라이즈
- 제로초예제
- nodejs교과서
- 리액트기초
- mongo
- npm명령어
- sequelize
- 리액트컴포넌트
- express-generator
- NoSQL
Archives
- Today
- Total
개발노트
npm명령어 두개 한번에 동시 실행하기 본문
terminal 관련 package (npm-run-all, ttab)
"scripts": {
"dev": "run-s tab:json-server serve",
"serve": "nuxt --open",
"build": "nuxt build",
"start": "nuxt start",
"tab:json-server": "ttab -w json-server --watch fake-server/db.json --port 3001"
},
npm run dev 명령어 입력으로. dev에 작성된 (띄어쓰기구분으로) 두개의 명령실행가능.
(원래 npm run dev 하고
터미널창을 하나 더켜서 json-server --watch fake-server/db.json --port 3001" 명령어를 입력하고 있었다.)
npm run tab:json-server
npm run serve
npm-run-all
명령어 여러개 입력가능
ttab
새로운 윈도우창으로 (json-server)실행 가능.
ttab + npm-runall (예제 동영상)
https://egghead.io/lessons/npm-open-multiple-terminal-tabs-on-npm-start-with-ttab-and-npm-run-all
npm-run-all > run-s
https://github.com/mysticatea/npm-run-all/blob/master/docs/run-s.md
새 terminal 열려고 설치한 ttab 패키지 기능이 --parallel 명령어로 대체가능해서 아래와 같이 수정
"scripts": {
"dev": "npm-run-all --parallel run:json-server serve",
"serve": "nuxt --open",
"build": "nuxt build",
"start": "nuxt start",
"run:json-server": "json-server --watch fake-server/db.json --port 3001"
},
"scripts": {
"dev": "npm-run-all --parallel run:json-server run:backend-server serve",
"serve": "nuxt --open",
"build": "nuxt build",
"start": "nuxt start",
"lint": "eslint --ext \".js,.vue\" --ignore-path .gitignore",
"run:json-server": "json-server --watch fake-server/db.json --port 3001",
"run:backend-server":"npm run dev --prefix back-end",
"test": "jest --watchAll"
},
"run:backend-server" :"npm run dev --prefix back-end"
=> back-end 디렉토리로 이동하여 npm run dev 실행
npm run dev 실행시 run:back-endserver 명령어도 같이 실행시켜줌~~
'Node js > npm' 카테고리의 다른 글
express-generator (0) | 2021.10.14 |
---|