Skip to content

Instantly share code, notes, and snippets.

@sankita15
Last active December 28, 2019 09:35
Show Gist options
  • Save sankita15/33628438339fd7ad4df15a63729fc0a6 to your computer and use it in GitHub Desktop.
Save sankita15/33628438339fd7ad4df15a63729fc0a6 to your computer and use it in GitHub Desktop.
Gradle task
node {
version = '12.12.0'
yarnVersion = '1.15.2'
download = false
yarnWorkDir = file("${project.buildDir}/yarn")
nodeModulesDir = file("${project.projectDir}/../frontend")
}
task appYarnInstall(type: YarnTask) {
description = "Installs all dependencies from package.json"
workingDir = file("${project.projectDir}/../frontend")
args = ["install"]
}
task appYarnBuild(type: YarnTask) {
description = "Builds production version of the travel-mania frontend"
workingDir = file("${project.projectDir}/../frontend")
args = ["build"]
}
task copyWebApp(type: Copy) {
from "${project.projectDir}/../frontend/build/"
into "${project.buildDir}/resources/main/static/."
}
appYarnBuild.dependsOn appYarnInstall
copyWebApp.dependsOn appYarnBuild
compileJava.dependsOn copyWebApp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment