Skip to content

Commit

Permalink
enable lowres source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 29, 2015
1 parent a6f20ac commit 846a219
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cli.js
Expand Up @@ -297,10 +297,11 @@ process.on('uncaughtException', function(err) {
break;

case 'bundle':
var options = readOptions(args, ['--inject', '--yes', '--skip-source-maps', '--minify']);
var options = readOptions(args, ['--inject', '--yes', '--skip-source-maps', '--minify', '--hires-source-maps']);
if (options.yes)
ui.useDefaults();
options.sourceMaps = !options['skip-source-maps'];
options.lowResSourceMaps = !options['hires-source-maps'];
var bArgs = options.args.splice(1);

if (bArgs.length < 2) {
Expand Down Expand Up @@ -341,8 +342,9 @@ process.on('uncaughtException', function(err) {

case 'b':
case 'bundle-sfx':
var options = readOptions(args, ['--yes', '--skip-source-maps', '--minify']);
var options = readOptions(args, ['--yes', '--skip-source-maps', '--minify', '--hires-source-maps']);
options.sourceMaps = !options['skip-source-maps'];
options.lowResSourceMaps = !options['hires-source-maps'];
if (options.yes)
ui.useDefaults();
var bArgs = options.args.splice(1);
Expand Down
6 changes: 4 additions & 2 deletions lib/bundle.js
Expand Up @@ -20,8 +20,6 @@ var systemBuilder = require('systemjs-builder');
var fs = require('fs');
var asp = require('rsvp').denodeify;

var isWin = process.platform.match(/^win/);

exports.depCache = function(moduleName) {
return config.load()
.then(function() {
Expand Down Expand Up @@ -146,6 +144,8 @@ exports.bundle = function(moduleExpression, fileName, opts) {
});
ui.log('ok', '`' + bundleName + '` added to config bundles.');
}
if (!('lowResSourceMaps' in opts))
opts.lowResSourceMaps = true;
return systemBuilder.buildTree(buildTree, fileName, opts);
})
.then(function() {
Expand Down Expand Up @@ -190,6 +190,8 @@ exports.bundleSFX = function(moduleName, fileName, opts) {
cfg.baseURL = path.relative(process.cwd(), config.pjson.baseURL);

opts.config = cfg;
if (!('lowResSourceMaps' in opts))
opts.lowResSourceMaps = true;

return systemBuilder.buildSFX(moduleName, fileName, opts);
})
Expand Down

0 comments on commit 846a219

Please sign in to comment.