node-gradle / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
601 stars 117 forks source link

Is it applicable to TypeScript projects? #261

Closed bvn13 closed 1 year ago

bvn13 commented 1 year ago

I tried this task:

def buildTask = tasks.register("buildWebapp", NpxTask) {
    command = "tsc"
    //args = ["--outDir", "${buildDir}/webapp/public"]
    dependsOn(yarn)
    inputs.dir(fileTree("src").exclude("**/*.test.js").exclude("**/*.spec.js").exclude("**/__tests__/**/*.js"))
    inputs.dir("node_modules")
    inputs.dir("public")
    outputs.dir("${buildDir}/webapp")
    environment = ["BUILD_PATH": "${buildDir}/webapp/public"]
}

but generated jar file is empty.

deepy commented 1 year ago

Task itself looks ok, I suspect you want to depend on yarnInstall instead though

But is your jar configured to get the app from $buildDir/webapp? And have you verified that if you run buildWebApp the app is built into $buildDir/webapp?