diff --git a/lib/parse/amd.js b/lib/parse/amd.js
index <HASH>..<HASH> 100644
--- a/lib/parse/amd.js
+++ b/lib/parse/amd.js
@@ -105,9 +105,13 @@ AMD.prototype.parseFile = function (filename) {
 AMD.prototype.addOptimizedModules = function (filename) {
 	var self = this;
 
-	amdetective(this.getFileSource(filename)).forEach(function (obj) {
+	amdetective(this.getFileSource(filename))
+		.filter(function(obj) {
+			var id = obj.name;
+			return id !== 'require' && id !== 'exports' && id !== 'module' && !id.match(/\.?\w\!/) && !self.isExcluded(id);
+		})
+		.forEach(function (obj) {
 		if (!self.isExcluded(obj.name)) {
-
 			self.tree[obj.name] = obj.deps.filter(function(id) {
 				return id !== 'require' && id !== 'exports' && id !== 'module' && !id.match(/\.?\w\!/) && !self.isExcluded(id);
 			});
added plugin filtering and excludes to optimized packages