Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 764 Bytes

README.md

File metadata and controls

30 lines (24 loc) · 764 Bytes

DiffPlug Webtools

  • node - hassle-free npm install and npm run blah
  • static server - a simple static file server

Node

apply plugin: 'com.diffplug.webtools.node'
node {
  // looks for an `.nvmrc` in this folder or its parent
  // downloads the corresponding version of node `npm ci`

  // and then it will run `npm run blah` like so
  npm_run 'blah', {
    inputs.file('tsconfig.json').withPathSensitivity(PathSensitivity.RELATIVE)
    inputs.dir('somedir').withPathSensitivity(PathSensitivity.RELATIVE)
    outputs.dir('build/some-output')
  }
}

Static Server

tasks.register('serve', com.diffplug.webtools.serve.StaticServerTask) {
  dir = file('build/static')
  port = 8080 // by default
}