metalsmith-simplewatch

2.0.0 • Public • Published

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][multimatch] 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.

/metalsmith-simplewatch/

    Package Sidebar

    Install

    npm i metalsmith-simplewatch

    Weekly Downloads

    1

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • christophercliff