Ionic CLI doesn't run gulp tasks on ionic serve


I tried this and it’s not working for me… but I see it works for most… so thinking I’m doing something wrong. I updated my gulp file.js with your edit… and I created the ionic.config.json file. Am I suppose to reference/load the ionic.config.json file from another file, or does Ionic just pick the file up by it being loaded at root of project?


Worked for me.


Yes! With “ionic serve” the gulp task now runnig but I have used gulp.task('serve:after', ['default']); because with serve:before the localhost server not ran

Just a question about my ionic info. Do you know miss Gulp Info here?
Cordova CLI: 6.4.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: 1.9.0
ios-sim version: 3.1.1
OS: macOS Sierra
Node Version: v6.9.1
Xcode version: Xcode 8.2.1 Build version 8C1002


For those who want to run npm scripts instead of ‘ionic serve’, you just need to run, concurrently, both ionic serve and gulp watch/tasks. 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


Thanks for the solution. Was a nightmare for me to solve. Could’ve lost hours.



If you are using the latest Ionic CLI (v3.x +) you should not update the ionic.config.json file and you should use gulp.task('ionic:watch:before', ['default']). instead of gulp.task('serve:before', ['default']); in your gulpfile.js


Thanks, this works!

I was using ionic 1 but my cli is v3.9.1 and need a way to run my gulp task.


In an ionic 1 project I had recover I also had to modify the package.json moving “gulp” from “dependencies” to “devDependencies” section to activate gulp tasks…


Thank you, its works. Just move the dependency to:

“devDependencies”: {
“bower”: “^1.3.3”,
“grunt”: “^1.0.2”,
“grunt-contrib-compress”: “^1.4.3”,
“grunt-contrib-uglify”: “^3.3.0”,
“gulp”: “^3.5.6”,
“gulp-concat”: “^2.2.0”,
“gulp-minify-css”: “^0.3.0”,
“gulp-rename”: “^1.2.0”,
“gulp-angular-templatecache”: “^2.2.0”,
“gulp-ng-annotate”: “^2.1.0”,
“gulp-sass”: “^4.0.1”,
“gulp-useref”: “^3.1.5”,
“gulp-util”: “^2.2.14”,
“node-sass”: “^4.8.3”,
“sass-graph”: “^2.2.4”,
“shelljs”: “^0.3.0”