1
0
Fork 0
mirror of https://github.com/archtechx/airwire.git synced 2025-12-12 02:34:04 +00:00
This commit is contained in:
Samuel Štancl 2021-05-20 20:15:55 +02:00
commit d26fa93f1e
35 changed files with 2388 additions and 0 deletions

View file

@ -0,0 +1,23 @@
const chokidar = require('chokidar');
const exec = require('child_process').exec;
class AirwireWatcher {
constructor(files = 'app/**/*.php') {
this.files = files;
}
apply(compiler) {
compiler.hooks.afterEnvironment.tap('AirwireWatcher', () => {
chokidar
.watch(this.files, { usePolling: false, persistent: true })
.on('change', this.fire);
});
}
fire() {
exec('php artisan airwire:generate');
console.log('Rebuilding Airwire definitions');
}
}
module.exports = AirwireWatcher;