parent
45048d9bb6
commit
8b1ba8c9b4
@ -0,0 +1,30 @@ |
|||||||
|
/** |
||||||
|
* @author Robert Strutts <Robert@TryingToScale.com> |
||||||
|
* @copyright Copyright (c) 2022, Robert Strutts. |
||||||
|
* @license https://mit-license.org/
|
||||||
|
*/ |
||||||
|
|
||||||
|
const { src, dest, series, parallel, watch } = require('gulp'); |
||||||
|
const exec = require('child_process').exec; |
||||||
|
|
||||||
|
const php_source_files = [ |
||||||
|
'**/*.php', |
||||||
|
'!**/dist/*.php' |
||||||
|
]; |
||||||
|
|
||||||
|
function compile_php_files() { |
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
exec('php -f compiler.php', function (err, stdout, stderr) { |
||||||
|
console.log(stdout); |
||||||
|
console.log(stderr); |
||||||
|
resolve(stdout); |
||||||
|
}); |
||||||
|
});
|
||||||
|
} |
||||||
|
|
||||||
|
function watch_php() { |
||||||
|
process.chdir('src');
|
||||||
|
watch(php_source_files, compile_php_files); |
||||||
|
} |
||||||
|
|
||||||
|
exports.default = series(watch_php); |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
{ |
||||||
|
"name": "tts_watch_php_compiler", |
||||||
|
"version": "1.0.0", |
||||||
|
"description": "TTS Framework PHP Compiler.", |
||||||
|
"main": "gulpfile.js", |
||||||
|
"scripts": { |
||||||
|
"test": "echo \"Error: no test specified\" && exit 1" |
||||||
|
}, |
||||||
|
"author": "Robert Strutts", |
||||||
|
"license": "MIT", |
||||||
|
"devDependencies": { |
||||||
|
"gulp": "^4.0.2" |
||||||
|
}, |
||||||
|
"overrides": { |
||||||
|
"chokidar": "3.5.3", |
||||||
|
"glob-parent": "6.0.2" |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue