Server IP : 162.213.251.212 / Your IP : 18.223.125.35 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/home/allssztx/./www/easybuyer/node_modules/laravel-mix/src/tasks/ |
Upload File : |
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;