   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
+exports.cleanModuleName = cleanModuleName = (path, nameCleaner) ->
+  nameCleaner path.replace(new RegExp('\\\\', 'g'), '/')
+
+commonJsWrapper = (addSourceURLs = no, nameCleaner) -> (fullPath, data, isVendor) ->
+  sourceURLPath = cleanModuleName fullPath, nameCleaner
   moduleName = sourceURLPath.replace /\.\w+$/, ''
   path = JSON.stringify moduleName
 

});
"""

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

  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) ->
