-
Notifications
You must be signed in to change notification settings - Fork 369
Closed
Description
With TypeScript compiler configured to use system modules, I'm getting source maps with empty mappings when original files are one liners (i.e. export * from './some/es6/module';). These source maps have their sources and sourcesContent collections filled in correctly. Chrome does not have any problems with such source maps, meaning they are used and displayed correctly.
With such source maps, SourceMapGenerator.fromSourceMap returns a generator without _sources collection set, which I presume is a bug.
To reproduce this behavior, I added following test in this project:
// in test/test-source-map-generator.js
exports['test .fromSourceMap with empty mappings'] = function (assert) {
var map = SourceMapGenerator.fromSourceMap(
new SourceMapConsumer(util.testMapEmptyMappings));
util.assertEqualMaps(assert, map.toJSON(), util.testMapEmptyMappings);
};
// in test/utils.js
exports.testMapEmptyMappings = {
version: 3,
file: 'min.js',
names: [],
sources: ['one.js', 'two.js'],
sourcesContent: [
' ONE.foo = 1;',
' TWO.inc = 2;'
],
sourceRoot: '',
mappings: ''
};
I can prepare PR with fix (and some more tests) if this is useful.
nenadvicentic and blompie1983
Metadata
Metadata
Assignees
Labels
No labels