metalsmith-if0.1.1 • Public • Published
A metalsmith plugin for adding conditional steps to your build process.
This is very useful when paired with metalsmith-watch and metalsmith-serve for skipping those plugins based on command-line flags or when in a non-interactive environment, for instance.
$ npm install metalsmith-if --save
Pass the plugin to
var msIf = ;metalsmith;
The conditional can be any truthy or falsy statement; the plugin will run as if it had been called directly inside the use().
One 'gotcha': when using
metalsmith-watch or other plugins that perform some
immediate action upon instantiating (i.e. the
you may need to use the same conditional inside the options object to disable
that. For example:
optswatch = false;metalsmith