Skip to content

Commit 52ff013

Browse files
committed
Breaking: Remove mapFile option
1 parent b2dee7c commit 52ff013

File tree

3 files changed

+3
-26
lines changed

3 files changed

+3
-26
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ function write(file, options, callback) {
8787
var sourceMap = file.sourceMap;
8888

8989
// fix paths if Windows style paths
90+
// TODO: should we be normalizing at all?
91+
// An end-user can use @gulp-sourcemaps/map-file if they need normalization
9092
sourceMap.file = helpers.unixStylePath(file.relative);
9193

9294
// TODO: should we be normalizing at all?

lib/helpers.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,7 @@ function contentIncluded(file, state, options, callback) {
293293
// TODO: use convert-source-map .toComment() when we upgrade and have charset support
294294
comment = commentFormatter(file, 'data:application/json;charset=utf8;base64,' + base64Map);
295295
} else {
296-
var mapFile;
297-
298-
// A function option here would have already been resolved higher up
299-
// TODO: need a test for this as a string
300-
if (options.mapFile) {
301-
// custom map file name
302-
mapFile = options.mapFile;
303-
} else {
304-
mapFile = path.join(state.destPath, file.relative) + '.map';
305-
}
296+
var mapFile = path.join(state.destPath, file.relative) + '.map';
306297

307298
var sourceMapPath = path.join(file.base, mapFile);
308299

test/write.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -236,22 +236,6 @@ describe('write', function() {
236236
});
237237
});
238238

239-
it.skip('should allow to rename map file', function(done) {
240-
var file = makeFile();
241-
sourcemaps.write(file, { path: '../maps', mapFile: function(mapFile) {
242-
return mapFile.replace('.js.map', '.map');
243-
}, destPath: 'dist' }, function(err, updatedFile, sourceMapFile) {
244-
expect(updatedFile instanceof File).toExist();
245-
expect(updatedFile).toEqual(file);
246-
expect(String(updatedFile.contents)).toBe(sourceContent + '\n//# sourceMappingURL=../maps/helloworld.map\n');
247-
expect(updatedFile.sourceMap.file).toBe('../dist/helloworld.js');
248-
expect(sourceMapFile instanceof File).toExist();
249-
expect(sourceMapFile.path).toBe(path.join(__dirname, 'maps/helloworld.map'));
250-
expect(JSON.parse(sourceMapFile.contents)).toEqual(updatedFile.sourceMap);
251-
done(err);
252-
});
253-
});
254-
255239
it('should create shortest path to map in file comment', function(done) {
256240
var file = makeNestedFile();
257241
sourcemaps.write(file, { path: 'dir1/maps' }, function(err, updatedFile) {

0 commit comments

Comments
 (0)