metalsmith-watcher

Watch and rebuild your metalsmith source files

Usage no npm install needed!

<script type="module">
  import metalsmithWatcher from 'https://cdn.skypack.dev/metalsmith-watcher';
</script>

README

metalsmith-watch

Build Status Dependencies

Installation

npm install metalsmith-watcher

Usage

Default Usage

metalsmith-watcher will watch and rebuild all source files upon change

var Metalsmith = require('metalsmith');
var watch = require('metalsmith-watcher');

Metalsmith(__dirname)
.source('src/')
.use(watch())
.build(cb);
Patterns

(coming soon) .. specify what to watch and what to rebuild

Metalsmith(__dirname)
.use(watch([
  [['src/scss/\*'], ['src/scss/main.scss’]], // Rebuilds main.scss when scss files change
  [['templates/\*', '!templates/ignorethis.file'], ['src/\*.md']] // Ignores 'ignorethis.file'
]))
.build();

To Test

npm test