Watching Sass files from `ionic serve`, new in cli v1.1.9

This works for me. Ionic guys please update this!

You have two options; either start gulp as
gulp sass watch
Of course you will need to add other gulp tasks if you have any. In my case, I am just having a sass task.
The other option is to modify the gulpfile.js and modify the gulp.task line to be
gulp.task('default', ['sass', 'watch']);
And then you can just call
gulp
However, since watch is a daemon and will keep running, you may need to send it to the background. So try
Make sure you wait about 5-10 seconds so that the processes are actually started and up and running
On Windows:
Start /B gulp
or
Start /B gulp sass watch

On Linux:
gulp &
or
gulp sass watch &

In my project, I added

gulp.task('serve:before', ['watch']);

to my gulpfile.js and it worked.

5 Likes

Perfect solution…
It is working for me.

Worked perfectly!!! I was trying to make it works a long time ago!

Thank you! editing gulp.js works.

Since gulp is very outdated these days, it had to go. How do one tell ionic serve in a v1 project to run npm run sass instead of gulp sass to build the scss/sass files?