mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
Fix module-not-found crash, changelog
This commit is contained in:
parent
d5a8a03c8f
commit
89cba981da
@ -1,3 +1,8 @@
|
||||
## 1.1.0
|
||||
|
||||
* Add `external` option that allows the user to whitelist specific external
|
||||
modules to be included in with documentation.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
* Fixes sorting order of documentation
|
||||
|
||||
3
index.js
3
index.js
@ -20,6 +20,9 @@ var mdeps = require('module-deps'),
|
||||
* @name documentation
|
||||
* @param {Array<String>|String} indexes files to process
|
||||
* @param {Object} options options
|
||||
* @param {Array<string>} options.external a string regex / glob match pattern
|
||||
* that defines what external modules will be whitelisted and included in the
|
||||
* generated documentation.
|
||||
* @return {Object} stream of output
|
||||
*/
|
||||
module.exports = function (indexes, options) {
|
||||
|
||||
@ -30,6 +30,8 @@ module.exports = {
|
||||
// grab the path of the top-level node_modules directory.
|
||||
var topNodeModules = path.join(path.dirname(index), 'node_modules');
|
||||
return function matchGlob(file, pkg) {
|
||||
// if a module is not found, don't include it.
|
||||
if (!file || !pkg) return false;
|
||||
// if package.json specifies a 'main' script, strip that path off
|
||||
// the file to get the module's directory.
|
||||
// otherwise, just use the dirname of the file.
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
require('external');
|
||||
require('external2');
|
||||
require('module-not-found');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user