We’re doing exactly that by having a multi-project build, with two subprojects, backend and frontend.
In the frontend, we apply the base plugin and the com.moowork.node plugin. Running an ng build simply consists in adding
"build": "ng build --prod" in the scripts section of the package.json file, and using
in the frontend gradle build.
In the backend gradle build, we use the spring-boot-gradle-plugin, and simply customize the jar task so that it includes the files generated by the frontend build:
Hope it helps.