metalsmith-simplewatch
v2.0.0
Published
A development server for Metalsmith
Downloads
4
Maintainers
Readme
metalsmith-simplewatch
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.