Ionic2 cli doesn’t hook gulp tasks on npm scripts

Hello all,

I added serve:before hook for ionic serve to run my gulp watch, and it works when you run ‘ionic serve’. However, if I map that command to a npm script, the hook doesn’t work anymore after running npm script which is exactly the same as ‘ionic serve’ by the way.

Any ideas?

I also have this doubt. Anyone?


Found a solution! You just need to run, concurrently, both ionic serve and gulp watch. What I did is:

Installed concurrently:

$ npm i concurrently --save-dev

Changed my npm scripts to:

“start”: “npm run serve”,
“serve”: “concurrently --kill-others "gulp watch" "ionic serve"”

And worked fine! =D