The benefit of this PR is to allow individual design doc parts to be easily unit tested with tools like mocha by writing them as require-able CommonJS modules.
Changes include:
options.exports added to couch-compile task
tests
patch version increment
readme docs for options.exports and options.pattern
This is a non-destructive, fully backwards compatible change.
When options.exports is set to a glob pattern, design doc parts which match the pattern(s) are interpreted as modules and the contents of module.exports is written to the design document instead of the raw text of the file.
The benefit of this PR is to allow individual design doc parts to be easily unit tested with tools like mocha by writing them as require-able CommonJS modules.
Changes include:
options.exports
added tocouch-compile
taskoptions.exports
andoptions.pattern
This is a non-destructive, fully backwards compatible change.
When
options.exports
is set to a glob pattern, design doc parts which match the pattern(s) are interpreted as modules and the contents ofmodule.exports
is written to the design document instead of the raw text of the file.