How can I start PHPStorm deployment from Gulp.js

I use Gulp.js to watch sass files in my project and automatically compile / reduce them. I have my PHPStorm installed to automatically deploy (download) modified files, including external changes.

The problem I am facing is that PHPStorm does not recognize external file changes until I switch to another application and then back to PHPStorm. Is there any way I could programmatically tell PHPStorm when to check for modified files?

Thanks in advance for your help!

+6
source share
2 answers

you should run the gulp command with a return, for example:

return gulp.src(PATHS.site_src + 'Styles/*.scss') 
0
source

I used rsync inside my gulp ie observation task

 gulp.task('watch', function() { var watcher = gulp.watch('/path/to/sassfile.scss', ['sass']); watcher.on('change', function(event) { console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); gulp.src('/path/to/compiledcss.css') .pipe(rsync({ hostname: 'dev.example.com', username: 'foo', progress: true, destination: '/path/on/remote/server' })); }); }); 

You need to download gulp -rsync ( https://www.npmjs.com/package/gulp-rsync ) and create the correct paths, but this seems to work for me

-1
source

Source: https://habr.com/ru/post/977048/


All Articles