   modules              = config.modules      ?= {}
   modules.wrapper     ?= 'commonjs'
   modules.definition  ?= 'commonjs'
+  modules.strict      ?= yes
 
   config.server       ?= {}
   config.server.base  ?= ''

normalizeConfig = (config) ->
  normalized = {}
  normalized.join = createJoinConfig config.files
  normalized.modules = {}
  normalized.modules.wrapper = normalizeWrapper config.modules.wrapper
  normalized.modules.definition = normalizeDefinition config.modules.definition
  normalized.conventions = {}
  Object.keys(config.conventions).forEach (name) ->
    normalized.conventions[name] = normalizeChecker config.conventions[name]

    .reduce(listToObj, {})
  Object.freeze(result)

indent = (data, strict) ->
  result = ''
  result += if strict then "'use strict';\n  " else ""
  result += data.replace /\n(?!\n)/g, '\n  '
  result

normalizeWrapper = (typeOrFunction, strict) ->
  switch typeOrFunction
    when 'commonjs'
      (path, data) ->
        """
  window.require.define({#{path}: function(exports, require, module) {
    #{indent data, strict}
  }});\n\n
  """
    when 'amd'
      (path, data) ->
        """
  define(#{path}, ['require', 'exports', 'module'], function(require, exports, module) {
    #{indent data, strict}
  });
  """
    when false then (path, data) -> "#{data}"
