mirror of
https://github.com/archtechx/airwire.git
synced 2025-12-12 02:34:04 +00:00
initial
This commit is contained in:
commit
d26fa93f1e
35 changed files with 2388 additions and 0 deletions
23
resources/js/AirwireWatcher.js
Normal file
23
resources/js/AirwireWatcher.js
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue