2.0.0 • Published 11 years ago
metalsmith-simplewatch v2.0.0
metalsmith-simplewatch
A development server for Metalsmith.
Installation
npm install metalsmith-simplewatchUsage
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
buildFnFunctionThe build function. Will be invoked every time a watched file is modified. Required.
buildPathStringThe absolute path to your build directory. Required.
patternString|Array<String>A pattern to filter source files. Default
'**/*'.portNumberThe port for the development server to listen on. Default
8000.srcPathStringThe absolute path to your source directory. Serves as the root watch directory. Required.
Tests
$ npm testLicense
MIT License, see LICENSE for details.
