 });
 """
 
-normalizeWrapper = (typeOrFunction, addSourceURLs) ->
+normalizeWrapper = (typeOrFunction, addSourceURLs, nameCleaner) ->
   switch typeOrFunction
-    when 'commonjs' then commonJsWrapper addSourceURLs
+    when 'commonjs' then commonJsWrapper addSourceURLs, nameCleaner
     when 'amd'
       (fullPath, data) ->
-        path = cleanModuleName fullPath
+        path = cleanModuleName fullPath, nameCleaner
         """
 define('#{path}', ['require', 'exports', 'module'], function(require, exports, module) {
 #{data}

  new SourceNode 1, 0, null, code.split('\n').map (line, index) ->
    new SourceNode index + 1, 0, source, (line + '\n')

exports.cleanModuleName = cleanModuleName = (path) ->
  path
    .replace(new RegExp('\\\\', 'g'), '/')
    .replace(/^app\//, '')

commonJsWrapper = (addSourceURLs = no) -> (fullPath, data, isVendor) ->
  sourceURLPath = cleanModuleName fullPath
  moduleName = sourceURLPath.replace /\.\w+$/, ''
  path = JSON.stringify moduleName


  mod = config.modules
  normalized.modules = {}
  sourceURLs = mod.addSourceURLs and not config.optimize
  normalized.modules.wrapper = normalizeWrapper mod.wrapper, sourceURLs, config.modules.nameCleaner
  normalized.modules.definition = normalizeDefinition mod.definition
  normalized.conventions = {}
  Object.keys(config.conventions).forEach (name) ->
