 
         # returns the on-disk filename for a css dep like 'css!100:foo.css'
         cssFilename = (moduleName) ->
-          filename = moduleName.replace /^css!(\d+:)?/, ''
-          if filename[-4..] isnt ".css" then filename + ".css" else filename
+          _.compose.apply(_, [
+            # remove plugin prefix css!100:
+            (n) -> n.replace /^css!(\d+:)?/, ''
+
+            # check the paths config, replace the path if it's in there
+            (n) ->
+              for pfx,pth of config.paths
+                if n[...pfx.length] is pfx
+                  return pth + n[pfx.length..]
+              n
+
+            # add the .css extension
+            (n) -> if n[-4..] isnt ".css" then n + ".css" else n
+
+            # prefix the path with the path to the static directory on disk
+            (n) -> join argv.staticpath, n
+          ].reverse())(moduleName)
 
         # returns the order for a css dep like 'css!100:foo.css'
         cssOrder = (moduleName) ->


        # return the contents of `filename` w/ the css url(...) paths
        # re-written appropriately
        cssWithPathsReWritten = (filename) ->
          updateCssPaths read(join(argv.staticpath, filename)), (url) ->
            if url[0] isnt "/"
              join(argv.baseurl, dirname(filename), url)
            else
              url

        output = (text, opts) ->
          text = minify(text) if opts.minify

          write cssName, cssText
          log "writing optimized#{opts.minify and "/minified" or ""} file to #{cssName}"

        profile = buildProfile()
        for module in profile.modules
          css = {}
          if isComponent() and /^\.[\/\\]/.test(module.name)
            module.name = join(config.paths[componentName()], module.name[2..])
          requirejs.optimize
            baseUrl: argv.staticpath
            paths: pathsConfig()
            shim: config.shim
            name: module.name
            optimize: "none"
            keepBuildDir: true
