Skip to content

diffplug/webtools

Repository files navigation

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
}

About

Gradle plugins for website tooling

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages