Comparing version 0.3.0 to 0.3.1
@@ -76,3 +76,3 @@ 'use strict'; | ||
if (this.opts.requireConfig) { | ||
mergeTrees(tree, requirejs.getShimDepsFromConfig(this.opts.requireConfig)); | ||
mergeTrees(tree, requirejs.getShimDepsFromConfig(this.opts.requireConfig, this.opts.exclude)); | ||
} | ||
@@ -79,0 +79,0 @@ |
@@ -12,11 +12,16 @@ 'use strict'; | ||
* @param {String} filename | ||
* @param {String} [exclude] | ||
*/ | ||
module.exports.getShimDepsFromConfig = function (filename) { | ||
module.exports.getShimDepsFromConfig = function (filename, exclude) { | ||
var deps = {}, | ||
config = parse.findConfig(filename, fs.readFileSync(filename, 'utf8')); | ||
config = parse.findConfig(filename, fs.readFileSync(filename, 'utf8')), | ||
excludeRegex = exclude ? new RegExp(exclude) : false, | ||
isIncluded = function (key) { | ||
return !(excludeRegex && key.match(excludeRegex)); | ||
}; | ||
if (config.shim) { | ||
Object.keys(config.shim).forEach(function (key) { | ||
Object.keys(config.shim).filter(isIncluded).forEach(function (key) { | ||
if (config.shim[key].deps) { | ||
deps[key] = config.shim[key].deps; | ||
deps[key] = config.shim[key].deps.filter(isIncluded); | ||
} else { | ||
@@ -23,0 +28,0 @@ deps[key] = []; |
{ | ||
"name": "madge", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"author": "Patrik Henningsson <patrik.henningsson@gmail.com>", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/pahen/node-madge", |
@@ -229,2 +229,5 @@ # MaDGe - Module Dependency Graph | ||
## v0.3.1 (June 03, 2014) | ||
Apply exclude to RequireJS shim dependencies (Thanks to Michael White). | ||
## v0.3.0 (May 25, 2014) | ||
@@ -231,0 +234,0 @@ Added support for onParseFile and onAddModule options (Thanks to Brandon Selway). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90042
2146
309