![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/clinic.corals.io/node_modules/laravel-mix/src/tasks/ |
let chokidar = require('chokidar'); class Task { /** * Create a new task instance. * * @param {Object} data */ constructor(data) { this.data = data; this.assets = []; this.isBeingWatched = false; } /** * Watch all relevant files for changes. * * @param {boolean} usePolling */ watch(usePolling = false) { if (this.isBeingWatched) return; let files = this.files.get(); let watcher = chokidar .watch(files, { usePolling, persistent: true }) .on('change', this.onChange.bind(this)); // Workaround for issue with atomic writes. // See https://github.com/paulmillr/chokidar/issues/591 if (!usePolling) { watcher.on('raw', (event, path, { watchedPath }) => { if (event === 'rename') { watcher.unwatch(files); watcher.add(files); } }); } this.isBeingWatched = true; } } module.exports = Task;