Skip to content

Commit

Permalink
Breaking: Remove identityMap option
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 17, 2017
1 parent 52ff013 commit 5871c2d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 111 deletions.
65 changes: 0 additions & 65 deletions lib/generate.js

This file was deleted.

15 changes: 0 additions & 15 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ var convert = require('convert-source-map');
var stripBom = require('strip-bom');
var detectNewline = require('detect-newline');

var generate = require('./generate');

var urlRegex = /^(https?|webpack(-[^:]+)?):\/\//;

function isRemoteSource(source) {
Expand Down Expand Up @@ -134,19 +132,6 @@ function fixImportedSourceMap(file, state, options, callback) {

function mapsLoaded(file, state, options, callback) {

if (!state.map && options.identityMap) {
var sourcePath = unixStylePath(file.relative);

switch (file.extname) {
case '.js':
state.map = generate.js(sourcePath, state.content);
break;
case '.css':
state.map = generate.css(sourcePath, state.content);
break;
}
}

if (!state.map) {
state.map = {
version: 3,
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
"vinyl-fs": "^2.4.3"
},
"dependencies": {
"acorn": "^4.0.3",
"async": "^2.1.4",
"convert-source-map": "1.3.0",
"css": "^2.2.1",
"detect-newline": "^2.1.0",
"graceful-fs": "^4.1.6",
"object.defaults": "^1.0.0",
"source-map": "^0.5.6",
"strip-bom": "^2.0.0",
"through2": "^2.0.1",
"vinyl": "^1.2.0"
Expand Down
28 changes: 0 additions & 28 deletions test/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,34 +165,6 @@ describe('add', function() {
});
});

it('should add a valid source if wished', function(done) {
sourcemaps.add(makeFile(), { identityMap: true }, function(err, data) {
expect(data).toExist();
expect(data).toExist();
expect(data.sourceMap).toExist();
expect(String(data.sourceMap.version)).toBe('3');
expect(data.sourceMap.sources[0]).toBe('helloworld.js');
expect(data.sourceMap.sourcesContent[0]).toBe(sourceContent);
expect(data.sourceMap.names).toEqual(['helloWorld', 'console','log']);
expect(data.sourceMap.mappings).toBe('AAAA,YAAY;;AAEZ,SAASA,UAAU,CAAC,EAAE;CACrBC,OAAO,CAACC,GAAG,CAAC,cAAc,CAAC;AAC5B');
done(err);
});
});

it('should add a valid source map for CSS if wished', function(done) {
sourcemaps.add(makeFileCSS(), { identityMap: true }, function(err, data) {
expect(data).toExist();
expect(data instanceof File).toExist();
expect(data.sourceMap).toExist();
expect(String(data.sourceMap.version)).toBe('3');
expect(data.sourceMap.sources[0]).toBe('test.css');
expect(data.sourceMap.sourcesContent[0]).toBe(sourceContentCSS);
expect(data.sourceMap.names).toEqual([]);
expect(data.sourceMap.mappings).toBe('CAAC;EACC;EACA');
done(err);
});
});

it('should import an existing inline source map', function(done) {
sourcemaps.add(makeFileWithInlineSourceMap(), { loadMaps: true }, function(err, data) {
expect(data).toExist();
Expand Down

0 comments on commit 5871c2d

Please sign in to comment.