From a98f7e5d516189ea2aa3112f165c9f73350c425f Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Wed, 19 Apr 2017 16:33:44 -0500 Subject: [PATCH] Breaking: Remove sourceMappingURLPrefix option --- lib/helpers.js | 6 ------ test/write.js | 28 ---------------------------- 2 files changed, 34 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index 8c8d1c6..da89a82 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -284,12 +284,6 @@ function contentIncluded(file, state, options, callback) { var sourceMapPathRelative = path.relative(path.dirname(file.path), sourceMapPath); - // A function option here would have already been resolved higher up - if (options.sourceMappingURLPrefix) { - var prefix = options.sourceMappingURLPrefix; - sourceMapPathRelative = prefix + path.join('/', sourceMapPathRelative); - } - if (!isRemoteSource(sourceMapPathRelative)) { comment = commentFormatter(file.extname, normalizePath(sourceMapPathRelative)); } else { diff --git a/test/write.js b/test/write.js index 4108e0d..baf4c54 100644 --- a/test/write.js +++ b/test/write.js @@ -351,34 +351,6 @@ describe('write', function() { }); }); - it('should accept a sourceMappingURLPrefix', function(done) { - var file = makeFile(); - sourcemaps.write(file, { - path: '../maps', - sourceMappingURLPrefix: 'https://asset-host.example.com' - }, function(err, updatedFile) { - if (/helloworld\.js$/.test(updatedFile.path)) { - expect(/sourceMappingURL.*\n$/.exec(String(updatedFile.contents))[0]).toEqual('sourceMappingURL=https://asset-host.example.com/maps/helloworld.js.map\n'); - done(err); - } - }); - }); - - it.skip('should accept a sourceMappingURLPrefix, as a function', function(done) { - var file = makeFile(); - sourcemaps.write(file, { - path: '../maps', - sourceMappingURLPrefix: function() { - return 'https://asset-host.example.com'; - } - }, function(err, updatedFile) { - if (/helloworld\.js$/.test(updatedFile.path)) { - expect(/sourceMappingURL.*\n$/.exec(String(updatedFile.contents))[0]).toEqual('sourceMappingURL=https://asset-host.example.com/maps/helloworld.js.map\n'); - done(err); - } - }); - }); - it.skip('should output an error message if debug option is set and sourceContent is missing', function(done) { var file = makeFile(); file.sourceMap.sources[0] += '.invalid';