Permalink
Browse files

CLI now tries to require local modules first

  • Loading branch information...
1 parent 44581c5 commit f4050a72b8ec2d56d815660a6072725d8ec38a74 @RobinThrift RobinThrift committed May 13, 2014
Showing with 6 additions and 1 deletion.
  1. +6 −1 bin/metalsmith
View
@@ -47,9 +47,14 @@ plugins.forEach(function(plugin){
for (var name in plugin) {
var opts = plugin[name];
var fn;
+ var localPath = resolve(process.cwd(), 'node_modules', name);
try {
- fn = require(name);
+ if (exists(localPath)) {
+ fn = require(localPath);
+ } else {
+ fn = require(name);
+ }
} catch (e) {
fatal('failed to require plugin "' + name + '".');
}

0 comments on commit f4050a7

Please sign in to comment.