From f4955ffb8df8ec7194982373e3e9550d6f2aed39 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 26 Jun 2014 12:51:38 -0400 Subject: [PATCH] closes #1729 --- src/meta.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/meta.js b/src/meta.js index 3a85243f77..04350cf319 100644 --- a/src/meta.js +++ b/src/meta.js @@ -312,11 +312,29 @@ var fs = require('fs'), return path !== null; }); + var pluginDirectories = []; + + plugins.clientScripts = plugins.clientScripts.filter(function(path) { + if (path.indexOf('.js') !== -1) { + return true; + } else { + pluginDirectories.push(path); + return false; + } + }); + // Add plugin scripts Meta.js.scripts = Meta.js.scripts.concat(plugins.clientScripts); - Meta.js.prepared = true; - callback(); + async.each(pluginDirectories, function(directory, next) { + utils.walk(directory, function(err, scripts) { + Meta.js.scripts = Meta.js.scripts.concat(scripts); + next(); + }); + }, function(err) { + Meta.js.prepared = true; + callback(); + }); }); }, minify: function(minify) {