Skip to content

Instantly share code, notes, and snippets.

@GeorgeBekh
Created May 7, 2019 13:45
Show Gist options
  • Save GeorgeBekh/11099a91b608af926a7e44e59779e368 to your computer and use it in GitHub Desktop.
Save GeorgeBekh/11099a91b608af926a7e44e59779e368 to your computer and use it in GitHub Desktop.
Cacheable exec task
task webpack(type: Exec) {
outputs.cacheIf { true }
inputs.file("package-lock.json")
inputs.dir("app")
// NOTE: Add inputs.file("webpack.config.js") for projects that have it
outputs.dir("$buildDir/js")
commandLine "$projectDir/node_modules/.bin/webpack", "app/index.js", "$buildDir/js/bundle.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment