title: Error while trying to build ember js project
body: <p>whenever i build my ember project with outputPath=dist and environment=production it build fine but when i build with outputPath=dist-something and environment=hosted-something then i get the below error:</p>
  
  <pre><code>Build failed.
  Invalid mapping: {"generated":{"line":74176,"column":-50},**"source":"bower_components/moment/min/moment.min.js"**,"original
  ":{"line":1,"column":0},"name":null}
  Error: Invalid mapping: {"generated":{"line":74176,"column":-50},"source":"bower_components/moment/min/moment.min.js","o
  riginal":{"line":1,"column":0},"name":null}
      at SourceMapGenerator_validateMapping [as _validateMapping] (C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEm
  ber\node_modules\ember-cli-uglify\node_modules\broccoli-uglify-sourcemap\node_modules\uglify-js\node_modules\source-map\
  lib\source-map\source-map-generator.js:272:15)
      at SourceMapGenerator_addMapping [as addMapping] (C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEmber\node_mo
  dules\ember-cli-uglify\node_modules\broccoli-uglify-sourcemap\node_modules\uglify-js\node_modules\source-map\lib\source-
  map\source-map-generator.js:102:12)
      at C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEmber\node_modules\ember-cli-uglify\node_modules\broccoli-ug
  lify-sourcemap\node_modules\uglify-js\node_modules\source-map\lib\source-map\source-map-generator.js:74:19
      at Array.forEach (native)
      at SourceMapConsumer_eachMapping [as eachMapping] (C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEmber\node_m
  odules\ember-cli-uglify\node_modules\broccoli-uglify-sourcemap\node_modules\uglify-js\node_modules\source-map\lib\source
  -map\source-map-consumer.js:473:10)
      at Function.SourceMapGenerator_fromSourceMap [as fromSourceMap] (C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLate
  stEmber\node_modules\ember-cli-uglify\node_modules\broccoli-uglify-sourcemap\node_modules\uglify-js\node_modules\source-
  map\lib\source-map\source-map-generator.js:50:26)
      at Context.SourceMap (C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEmber\node_modules\ember-cli-uglify\node_
  modules\broccoli-uglify-sourcemap\node_modules\uglify-js\lib\sourcemap.js:59:52)
      at Object.exports.minify (C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEmber\node_modules\ember-cli-uglify\n
  ode_modules\broccoli-uglify-sourcemap\node_modules\uglify-js\tools\node.js:112:38)
      at UglifyWriter.processFile (C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEmber\node_modules\ember-cli-uglif
  y\node_modules\broccoli-uglify-sourcemap\index.js:98:25)
      at C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEmber\node_modules\ember-cli-uglify\node_modules\broccoli-ug
  lify-sourcemap\index.js:46:14
  </code></pre>
  
  <p>would be great if somebody can let me know what the reason could be and also the solution
  <br/><br/>It seems to be a error when brocfile.js is being parsed by uglifyJs. Since currently in brcofile.js i use the below lines</p>
  
  <pre><code>app.import('bower_components/moment/min/moment.min.js');
  app.import('bower_components/jquery-file-upload/js/vendor/jquery.ui.widget.js');
  app.import('bower_components/jquery-file-upload/js/jquery.iframe-transport.js');
  app.import('bower_components/jquery-file-upload/js/jquery.fileupload.js');
  </code></pre>
  
  <p>However when i use the below order,</p>
  
  <pre><code>app.import('bower_components/jquery-file-upload/js/vendor/jquery.ui.widget.js');
  app.import('bower_components/jquery-file-upload/js/jquery.iframe-transport.js');
  app.import('bower_components/jquery-file-upload/js/jquery.fileupload.js');
  app.import('bower_components/moment/min/moment.min.js');
  </code></pre>
  
  <p>the error becomes</p>
  
  <blockquote>
    <p>Build failed. Invalid mapping:
    {"generated":{"line":74174,"column":-50},"source":"bower_components/jquery-file-upload/js/vendor/jquery
    .ui.widget.js","original":{"line":1,"column":0},"name":null} Error:
    Invalid mapping:
    {"generated":{"line":74174,"column":-50},<strong>"source":"bower_components/jquery-file-upload/js/vendor
    /jquery.ui.widget.js"</strong>,"original":{"line":1,"column":0},"name":null}
        at SourceMapGenerator_validateMapping [as _validateMapping] (C:\wamp\www\PublicMD\EmberMD\Ta\trunk\TextAdminLatestEm
    ber\node_modules\ember-cli-uglify\node_modules\broccoli-uglify-sourcemap\node_modules\uglify-js\node_modules\source-map\
    lib\source-map\source-map-generator.js:272:15)</p>
  </blockquote>
  
  <p>*********Update with entire borcfile as per comment suggestion******</p>
  
  <pre><code>var EmberApp = require('ember-cli/lib/broccoli/ember-app');
  
  
  var isProduction = ['production', 'hosted-something'].indexOf(process.env.EMBER_ENV) &gt; -1;
  
  var app = new EmberApp({
  
      fingerprint: {
          enabled: false
      },
  
      hinting: !isProduction,
  
      minifyCSS: {
          enabled: isProduction
      },
  
      minifyJS: {
          enabled: isProduction
      },
  
      storeConfigInMeta: false,
  
      tests: !isProduction,
  
      vendorFiles: {        
          'jquery.js': 'bower_components/jquery/dist/jquery.js',
  
          'handlebars.js': null,
  
          'ember.js': {
              'hosted-something':  'bower_components/ember/ember.prod.js'
          },
  
      },
  
      wrapInEval: !isProduction
  });
  
  if (app.env !== 'hosted-something') {
      app.import('bower_components/bootstrap-go/index.css');
      app.import('bower_components/bootstrap-go-responsive/index.css');
  }
  
  app.import('bower_components/moment/min/moment.min.js');
  app.import('bower_components/jquery-file-upload/js/vendor/jquery.ui.widget.js');
  app.import('bower_components/jquery-file-upload/js/jquery.iframe-transport.js');
  app.import('bower_components/jquery-file-upload/js/jquery.fileupload.js');
  
  module.exports = app.toTree();
  </code></pre>