 path = require 'path'
 _    = require 'underscore'
 
-bowerPathMap = JSON.parse fs.readFileSync('bower-paths.json', 'utf8')
-bowerPaths = _(for name, filename of bowerPathMap
+bowerVendorPath = "vendor/bower/"
+bowerPathMap    = JSON.parse fs.readFileSync('bower-paths.json', 'utf8')
+bowerPaths      = _(for name, filename of bowerPathMap
   if /(\.js$)|(\.coffee$)|(\.css$)|(\.styl$)|(\.less$)/.exec filename
     filename
   else

    stylesheets:
      joinTo:
        'css/app.css': (filename) ->
          /^vendor\/bower\//.exec(filename)? or vendorPath filename

    templates:
      joinTo:


vendorPath = (filename) ->
  if filename.indexOf('vendor/') is 0
    if filename.indexOf(bowerVendorPath) is 0
      filename in bowerPaths
    else
      filename.indexOf("brunch_JavaScriptCompiler_") < 0

  else
    false

# Specify css of certain vendor modules to ignore
cssIgnoreModules = [/jquery\.ui/]

beforePaths = _(bowerPaths).union([
    'src/main.coffee'
