μ΄κ²μ΄ μλνμ§ μλ μ΄μ λ 무μμ λκΉ? λ΄κ° λ μλͺ»νκ³ μμ΅λκΉ?
nodemon --watch src --exec 'yarn run build && yarn start'
src
μλ λͺ¨λ νμΌμ΄ μμ΅λλ€. μ λΉλλκ³ μμλμ§λ§ λ³κ²½ μ¬νμ΄ μμ΄λ λ€μ μμλμ§ μμ΅λλ€. μ΄λ€ μμ΄λμ΄?
μλ, μ무 μκ°μ΄ μμ΅λλ€.
srcμ μΆλ ₯μ΄λ tree
λ₯Ό λ³΄μ§ μκ³ λ λ λμ μμ΄λμ΄λ₯Ό μ 곡ν μ μμ΅λλ€.
μ£μ‘ν©λλ€. λ λ§μ μ 보λ₯Ό μ 곡νμ΄μΌ νμ΅λλ€.
src
μ νΈλ¦¬λ λ€μκ³Ό κ°μ΅λλ€.
src/
pages/
public/
css/
js/
index.js
scripts/
templates/
404.hbs
index.hbs
src/index.hbs
λ° src/public/js/index.js
λ³κ²½μ μλνμ§λ§ μλ²κ° λ€μ μμλμ§ μμ΅λλ€.
nodemonμ μ²μ μμν λμ μΆλ ₯μ λ€μκ³Ό κ°μ΅λλ€.
git:master β― nodemon --watch src --exec 'yarn run build && yarn start'
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /path/to/repo/src/**/*
[nodemon] starting `yarn run build && yarn start`
...
<server starts correctly>
λλ λν nodemon -L ...
λ° nodemon -e js,hbs ...
λ° nodemon --watch src/**/*.hbs
μλνμ§λ§ μ¬μ ν μ΄μ΄ μμ΅λλ€.
λ€μ μ¬λμκ° μλ src/
μ¬μΌ ν©λλ€.
λλ κ°μ λ¬Έμ λ₯Ό κ°μ§κ³ μλ€. νν μ¬λμκ° μλ μλ μλνμ§ μμ΅λλ€.
λ Έλλͺ¬ 1.11.0
λͺ μμ νμΌ μλ:
nodemon --watch src/index.ts --exec 'node out/index.js'
κ·Έλ€μνμ§ μμ΅λλ€ :
nodemon --watch 'src' --exec 'node out/index.js'
nodemon --watch src --exec 'node out/index.js'
nodemon --watch 'src/' --exec 'node out/index.js'
nodemon --watch src/ --exec 'node out/index.js'
nodemon --watch 'src/**/*.ts' --exec 'node out/index.js'
μ λ°μ΄νΈ μμ :
μ£μ‘ν©λλ€. nodemonμ verboseλ‘ μ€νν ν κΈ°λ³Έμ μΌλ‘ *.js νμΌλ§ κ°μ νλ€κ³ λ§νμ΅λλ€.
-e ts μ€μμΉλ₯Ό μΆκ°νλ©΄ λͺ¨λ λ€μ μλν©λλ€.
nodemon --watch src/ --exec 'λ Έλ μΆλ ₯/index.js' --verbose -e ts
λ€μμ @mcwienczek λ΅λ³μ κΈ°λ°μΌλ‘ νλ λ§€μ° κ°λ¨ν λ°±μ μ루μ μΌλ‘ μ μκ²
"watch": "nodemon --watch . --exec backup -e *"
μ΄κ²μ λͺ¨λ νμΌμ κ°μνκ³ λ³κ²½λ νμΌμ΄ μλ κ²½μ° λ³κ²½λ νμΌλ§ OneDriveμ 볡μ¬νλ backup.batλΌλ Windows λ°°μΉ νμΌμ μ€νν©λλ€.
μ΄κ²μ npmμ΄ μμμ μ€ν¬λ¦½νΈλ₯Ό μ€ννλλ‘ νλ μ μΌν λͺ λ Ήμ λλ€.
κ΄μ¬μ μν΄ λ€λ₯Έ νμΌμ ν¬ν¨ν©λλ€.
_backup.bat_
<strong i="13">@echo</strong> off
xcopy /d /s /y /EXCLUDE:backup-exclude.txt . C:\Users\<user>\OneDrive\code-backup
_backup-exclude.txt_
.git
node_modules
@philipjmurphyλ‘ μ’ λ£νλ©΄ λ€λ₯Έ μ¬λλ€μ΄ μ¬μ©ν μ μλ ν΄κ²° λ°©λ²μ΄ μμ΅λλ€(κ°μ¬ν©λλ€!).
μ€ν¬λ¦½νΈκ° μ¬λ°λ₯Έμ§ νμΈνμμμ€.
"μ€ν¬λ¦½νΈ": {
"μμ": "λ
Έλ server.js",
"μλ²": "nodemon server.js"
},
κ°μ₯ μ μ©ν λκΈ
λλ κ°μ λ¬Έμ λ₯Ό κ°μ§κ³ μλ€. νν μ¬λμκ° μλ μλ μλνμ§ μμ΅λλ€.
λ Έλλͺ¬ 1.11.0
λͺ μμ νμΌ μλ:
κ·Έλ€μνμ§ μμ΅λλ€ :
μ λ°μ΄νΈ μμ :
μ£μ‘ν©λλ€. nodemonμ verboseλ‘ μ€νν ν κΈ°λ³Έμ μΌλ‘ *.js νμΌλ§ κ°μ νλ€κ³ λ§νμ΅λλ€.
-e ts μ€μμΉλ₯Ό μΆκ°νλ©΄ λͺ¨λ λ€μ μλν©λλ€.
nodemon --watch src/ --exec 'λ Έλ μΆλ ₯/index.js' --verbose -e ts