title: Use gradle to build front-end in Spring Boot
body: <p>I have the following setup in my fullstack Spring boot + thymeleaf + react</p>
  
  <p>The project structure look like this</p>
  
  <p><code>
  build.gradle
  |src
    |main
      |java
      |resources
        index.js
        package.json
        build.gradle
  </code></p>
  
  <p>I use a gradle script under resources folder to build front end SPA.
  the script look like this</p>
  
  <pre><code>buildscript {
    repositories {
      maven {
        url "https://plugins.gradle.org/m2/"
      }
    }
    dependencies {
      classpath "com.moowork.gradle:gradle-node-plugin:1.2.0"
    }
  }
  
  apply plugin: "com.moowork.node"
  
  task build(type: YarnTask) {
      args = ['run', 'build']
  }
  build.dependsOn('yarn_install')
  task deleteModules(type: Delete) {
      delete "node_modules"
  }
  deleteModules.dependsOn('build')
  </code></pre>
  
  <p>The above build will build a SPA with <code>index.html</code> and <code>index.js</code></p>
  
  <p>My question is, how do I include this in the top level build.gradle. So that every time the java application is getting build, it will build the front-end SPA first </p>