Skip to content

Commit

Permalink
Merge pull request #45 from box/issue31
Browse files Browse the repository at this point in the history
Fix embedded sourcemap URL (fixes #31)
  • Loading branch information
nzakas committed Apr 23, 2015
2 parents 135b00e + 547522a commit 506cd94
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Makefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
require('shelljs/make');

var util = require('util'),
path = require('path'),
nodeCLI = require('shelljs-nodecli'),
semver = require('semver'),
dateformat = require('dateformat');
dateformat = require('dateformat'),
uglifyjs = require('uglify-js');

//------------------------------------------------------------------------------
// Data
Expand Down Expand Up @@ -244,8 +246,14 @@ target.dist = function() {
(versionComment + copyrightComment + cat(TESTING_FILES)).to(distTestingFilename);

// create minified version with source maps
nodeExec('uglifyjs', distFilename, '-o', minDistFilename,
'--source-map', minDistSourcemapFilename, '--comments', '"/^!/"');
var result = uglifyjs.minify(distFilename, {
output: {
comments: /^!/
},
outSourceMap: path.basename(minDistSourcemapFilename)
});
result.code.to(minDistFilename);
result.map.to(minDistSourcemapFilename);

// ensure there's a newline at the end of each file
(cat(distFilename) + '\n').to(distFilename);
Expand Down

0 comments on commit 506cd94

Please sign in to comment.