 jsShimMap = {}
 if config?
   paths = config.clientSettings.paths
-  for name, value of config.clientSettings.shim
+  shim = config.clientSettings.shim
+  buildConfig = {paths, shim}
+  for name, value of shim
     path = paths[name] ? name
     deps = ((paths[dep] ? dep) for dep in value.deps)
     jsShimMap[path] = {deps}

        when '.html', '.htm', '.css'
          # Run the source file through template engine
          sourceData = _.template(fs.readFileSync(source).toString(), _.extend({}, {settings}, htmlHelpers))
          sourceData = injectLiveReloadJS(sourceData)
          filename = sysPath.basename(source)
          path = sysPath.join destDir, filename
          fs.writeFileSync path, sourceData

    "?_#{(new Date()).getTime()}"
  else
    ''

# Module loader source
moduleLoaderSrc = fs.readFileSync(sysPath.join(__dirname, 'module_loader.coffee')).toString()
moduleLoaderSrc = _.template(moduleLoaderSrc, {settings})
moduleLoaderSrc = CoffeeScript.compile(moduleLoaderSrc)

liveReloadSrc = fs.readFileSync(sysPath.join(__dirname, 'live_reload.coffee')).toString()
liveReloadSrc = _.template(liveReloadSrc, {settings})
liveReloadSrc = CoffeeScript.compile(liveReloadSrc)

htmlHelpers =
  link_tag: (link, attrs={}) ->
