I have a frontend subproject, which build css and js bundles via
com.moowork.node plugin. It runs
npm run dev under the hood, and my bundles appears.
npm run dev calls webpack with some options.
Also I have a spring boot subproject, which started via
gradle bootRun task. Spring dev tools included in dependencies.
And last, I run
gradlew build -x test --continuous in root of my projects. After changing something, gradle build starts and builds all projects if needed: frontend first, then spring boot app. Spring dev tools see the changes in classpath and app reloads.
All works fine, except one problem: frontend builds every time as first time, and it is really slow. To fix it I need to run webpack with
--watch option. And do some other frontend build improvements, which need to
--watch option to webpack too.
But if I add
--watch option to webpack,
gradlew build -x test --continuous will never ends, because webpack now never ends. And build of my spring boot app never happens.
How to run
webpack --watch in
--continuous build in gradle?