Directory not being properly ignored

So, I’m running up against an issue which is really throwing me. I currently have bower installing components to /source/dependencies

In my config.rb I’m ignoring that entire directory, as well as appending it to Sprockets so that I can require some libs from within it:


activate :directory_indexes
activate :sprockets

after_configuration do  
  @bower_config = JSON.parse(IO.read("#{root}/.bowerrc"))
  @bower_assets_path = File.join "#{root}", @bower_config["directory"]
  sprockets.append_path @bower_assets_path
end

ignore 'dependencies/*'

Now, when attempting to build, I receive a stack trace with this at the top:

'require': cannot load such file -- less (LoadError)

I’ve tracked this back to a lib that I have sitting in that dependencies directory - Jcrop. If I remove this directory the build runs fine. My question is, why is Middleman attempting to parse any of the files in source/dependencies if I’m ignoring the entire directory?

If anyone can provide some insight I’d really appreciate it.

I’m not sure of the exact syntax when not using regex, but should it not be ignore 'dependencies/**/*' if you want to ignore both subdirectories and files?

Or try a regular expression instead /^dependencies\// if in source or /\/dependencies\// if further down.

Thanks @tommysundstrom. So, I tried both of those and still no dice. The bizarre thing is that if I explicitly ignore less files:

ignore 'dependencies/**/*.less'

Then the build works great. I feel like I have a pretty big misunderstanding of how the whole asset pipeline works in Middleman because of this.

I have no idea why that is so, but maybe you can find some clues here:

https://www.relishapp.com/middleman/middleman-core/docs/ignoring-paths