Reputation: 10645
I'm running my build with ng build --watch
, and I'd like to run a batch file after each build. How do I go about this?
Upvotes: 1
Views: 1217
Reputation: 18123
You need to use a build tool.
I recommend GulpJS
In your gulpfile something like this:
const spawn = require('child_process').spawn;
...
gulp.task('your-batch-function-here'], function (cb) {
<<your custom task here>>
});
gulp.task('ng-build', [], function (cb) {
spawn('npm', ['run', 'build'], {stdio: 'inherit'})
});
gulp.task('build', ['ng-build', 'your-batch-function-here'], function () {
});
If you start this with gulp build
, it will
1. run ann npm run build command
2. After it is finished, will run your batch function task (you must implement it as a gulp.task)
Upvotes: 1