Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run a gulp watch simultaneously than gretty

Tags:

I'm trying to run a gulp watch when running my Java web-app with Gretty. I'm using this plugin to run gulp from Gradle.

For the moment, I'm just able to run a single gulp build before the app run by doing this: appRun.dependsOn gulp_build

What I would like is that when I run the app, there is also gulp watch starting (task gulp_default in Gradle on my case), so that SCSS files are automatically compiled when I save them without having to restart the app.

I can't just do appRun.dependsOn gulp_build because gulp_default doesn't return anything, so the gradle task doesn't execute appRun.

Any idea how I can do this?

like image 870
ThibaultV Avatar asked Apr 09 '17 21:04

ThibaultV


1 Answers

I found a way, but by using npm to start the app and not gradle.

I used the concurrently package. I start the app by doing npm start instead of gradle appRun, and I added this in my package.json:

"scripts": {
  "start": "concurrently \"gradle appRun\" \"gulp watch\""
}
like image 114
ThibaultV Avatar answered Sep 23 '22 10:09

ThibaultV