LoginSignup
1
2

More than 5 years have passed since last update.

npm onchangeをWindowsで利用する際の注意

Posted at

npm onchangeが変更を全然検知してくれなかった件

onchange
https://www.npmjs.com/package/onchange

ファイルの変更を検知してコマンドを実行してくれる便利なモジュールです。
Readmeに書いてあるのですが、Windowsで使う際にはダブルクォーテーションを使わないとダメなのだそうです。

NOTE: Windows users may need to use double quotes rather than single quotes. If used in an npm script, remember to escape the double quotes.

ちゃんと書いてあることを読もうという反省を込めてここに残しておきます。

package.json(ダメな例)
    "start": "onchange 'index.js' -- node index.js"
package.json(良い例)
    "start": "onchange \"index.js\" -- node index.js"
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2