Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call "ng build" from inside a gulp task

I am using angular-cli in my project.I want to add some gulp tasks for deployment. Is it possible for me to call "ng build" from inside a gulp task ?

like image 225
Vinz and Tonz Avatar asked Oct 12 '16 10:10

Vinz and Tonz


1 Answers

you can use child_process to make a command line call:

var exec = require('child_process').exec;

gulp.task('build', function (cb) {
  exec('ng build', function (err, stdout, stderr) {
    console.log(stdout);
    console.log(stderr);
    cb(err);
  });
})

see also here: Running a shell command from gulp for other solutions.

like image 143
dokkis Avatar answered Nov 19 '22 19:11

dokkis