Skip to content

eggjs/egg-watcher-chokidar

Repository files navigation

egg-watcher-chokidar

NPM version build status Test coverage David deps Known Vulnerabilities npm download

if you use some network file systems or other virtualization software, an use default watcher can't detected file change. you can use this plugin;

Install

$ npm i egg-watcher-chokidar --save

Usage

// {app_root}/config/plugin.js
exports.watcherChokidar = {
  enable: true,
  package: 'egg-watcher-chokidar',
};

if you just want use it in local evniroment, you just add this config to ${app_root}/config/plugin.local.js file

Configuration

This plugin used chokidar and you can pass chokidar options as following.

// {app_root}/config/config.default.js
exports.watcherChokidar = {
  usePolling: true,
  alwaysStat: true,
};

see https://github.com/paulmillr/chokidar#api for more detail.

Questions & Suggestions

Please open an issue here.

License

MIT