jo / grunt-couch

Build and publish Couchapps and CouchDB design documents with grunt. Simple.
MIT License
48 stars 19 forks source link

Allow dd parts to be written as CommonJS modules #6

Closed tsclausing closed 11 years ago

tsclausing commented 11 years ago

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:

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.