Comparing version 0.3.1 to 0.4.0
@@ -205,2 +205,20 @@ /* | ||
/** | ||
* Excludes dependencies that match any of the patterns. | ||
* | ||
* @param {array} allDependencies array of dependencies to filter | ||
* @param {array} patterns array of patterns to match against | ||
* @return {array} items that don't match any of the patterns | ||
*/ | ||
var filterExcludedDependencies = function (allDependencies, patterns) { | ||
return _.transform(allDependencies, function (result, dependencies, fileType) { | ||
result[fileType] = _.reject(dependencies, function (dependency) { | ||
return _.find(patterns, function (pattern) { | ||
return dependency.match(pattern); | ||
}); | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Detect dependencies of the components from `bower.json`. | ||
@@ -214,9 +232,9 @@ * | ||
config.set('global-dependencies-sorted', { | ||
config.set('global-dependencies-sorted', filterExcludedDependencies({ | ||
js: prioritizeDependencies(config, '.js'), | ||
css: prioritizeDependencies(config, '.css'), | ||
scss: prioritizeDependencies(config, '.scss') | ||
}); | ||
}, config.get('exclude'))); | ||
return config; | ||
}; |
{ | ||
"name": "wiredep", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "Wire dependencies to your source code.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/stephenplusplus/wiredep", |
@@ -5,2 +5,3 @@ # wiredep | ||
## Getting Started | ||
@@ -16,3 +17,4 @@ Install the module with: `npm install wiredep --save` | ||
jsPattern: 'default: <script src="{{filePath}}"></script>', | ||
cssPattern: 'default: <link rel="stylesheet" href="{{filePath}}" />' | ||
cssPattern: 'default: <link rel="stylesheet" href="{{filePath}}" />', | ||
exclude: [ /jquery/, "bower_components/modernizr/modernizr.js" ] | ||
}); | ||
@@ -19,0 +21,0 @@ ``` |
Sorry, the diff of this file is not supported yet
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
15330
385
28