From c809913fe702597e47b9ba03c63156401406ad1b Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Tue, 30 Dec 2014 10:01:29 -0500 Subject: [PATCH] Using mold-source-maps to remove working path from source map It still shows up in the sourceURL embedded by a traceur compiler. Still need to work on that, but this is a little better. --- gulpfile.js | 6 ++++-- package.json | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index deb96fe..8f2fba6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -70,7 +70,8 @@ gulp.task('browserify', function() { var browserify = require('browserify'), exorcist = require('exorcist'), tap = require('gulp-tap'), - transform = require('vinyl-transform'); + transform = require('vinyl-transform'), + mold = require('mold-source-map'); return gulp.src('./src/js/main.js', { read: false }) .pipe(errorHandler()) @@ -81,7 +82,8 @@ gulp.task('browserify', function() { bundler.add(file.path); - file.contents = bundler.bundle(); + file.contents = bundler.bundle() + .pipe(mold.transformSourcesRelativeTo('./')); })) .pipe(transform(function() { return exorcist(config.buildPath('js/main.js.map')); diff --git a/package.json b/package.json index dbb8fe8..c4e4d17 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "karma-jasmine": "^0.3.1", "karma-notify-reporter": "^0.1.1", "lodash": "^2.4.1", + "mold-source-map": "^0.3.0", "q": "^1.1.2", "snapsvg": "git://github.com/adobe-webplatform/Snap.svg#dev", "through": "^2.3.6",