diff --git a/lib/browserify-rails/directive_processor.rb b/lib/browserify-rails/directive_processor.rb
index <HASH>..<HASH> 100644
--- a/lib/browserify-rails/directive_processor.rb
+++ b/lib/browserify-rails/directive_processor.rb
@@ -14,10 +14,7 @@ module BrowserifyRails
 
     def evaluate(context, locals, &block)
       if commonjs_module?
-        dependencies.each do |dep|
-          path = File.basename(dep["id"], context.environment.root)
-          next if path == File.basename(file)
-
+        dependencies.each do |path|
           if path =~ /<([^>]+)>/
             path = $1
           else
#dependencies already filter the file itself