Ionic run command with out livereload not invoking gulp sass task


#1

by running Ionic serve or ionic run android with livereload option. gulp sass task is ran and css is getting compliled. but when I run ionic run android with out livereload gulp sass task is not running and css is not updated . how can I update run gulp tasks on ionic run with out livereload option.


#2

Have a look at “gulpStartupTasks” property in ionic.project.


#3

I have following tasks in ionic.project.

“gulpStartupTasks”: [
“sass”,
“watch”
]

while running ‘ionic serve’ and ‘ionic run android with livereload’ sass task is excecuted but when i run ionic run android with live reload option sass task is not running


#4

Then you can add a cordova hook script to run your gulp tasks in prepare phase.


#5

thanks gmarziou it worked for me


#6

Can you give me an example of this? I have also the same problem in that once sass is properly setup as per the ionic docs, it only compiles the sass when doing “ionic serve” or runing with “live reload”

It should compile sass when doing “ionic run android” . how did you manage to fix this actually? i’m new with hooks…
Thanks!


#7

I created a cordova after prepare hook. In that I called gulp sass task.
this is my code in after prepare hook.

#!/usr/bin/env node
var gulp = require(‘gulp’);
var path = require(‘path’);

var rootdir = process.argv[2];
var gulpfile = path.join(rootdir, ‘gulpfile.js’);

process.stdout.write(‘Compiling SCSS’);

require(gulpfile);

gulp.start(‘sass’);