2.0.0 • Published 9 years ago

metalsmith-simplewatch v2.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
9 years ago

metalsmith-simplewatch

Build Status

A development server for Metalsmith.

Installation

npm install metalsmith-simplewatch

Usage

The watch function starts a developments server and rebuilds when source files are modified.

var watch = require('metalsmith-simplewatch')

watch({
  buildFn: build,
  buildPath: path.resolve(__dirname, './build/'),
  srcPath: path.resolve(__dirname, './src/'),
})

function build() {
  Metalsmith().build()
}

Options

  • buildFn Function

    The build function. Will be invoked every time a watched file is modified. Required.

  • buildPath String

    The absolute path to your build directory. Required.

  • pattern String|Array<String>

    A pattern to filter source files. Default '**/*'.

  • port Number

    The port for the development server to listen on. Default 8000.

  • srcPath String

    The absolute path to your source directory. Serves as the root watch directory. Required.

Tests

$ npm test

License

MIT License, see LICENSE for details.