gulp-concat-sourcemap
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -51,3 +51,3 @@ 'use strict'; | ||
if (opts.sourcesContent) { | ||
sourceNode.setSourceContent(file.relative, file.contents.toString('utf8')); | ||
sourceNode.setSourceContent(rel, file.contents.toString('utf8')); | ||
} | ||
@@ -54,0 +54,0 @@ } |
{ | ||
"name": "gulp-concat-sourcemap", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Concatenate files and generate a source map file", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -134,2 +134,50 @@ var expect = require('chai').expect; | ||
}); | ||
}); | ||
it('should generate source content inline', function(done){ | ||
var file1 = new File({ | ||
base: '/test', | ||
path: 'test/path/file1.js', | ||
contents: new Buffer('console.log(\'Hello\');') | ||
}); | ||
var file2 = new File({ | ||
base: '/test', | ||
path: 'test/path/file2.js', | ||
contents: new Buffer('console.log(\'World\');') | ||
}); | ||
var stream = concat('file.js', {prefix: 2, sourcesContent: true}); | ||
var contentFile; | ||
stream.on('data', function(newFile) { | ||
if (!contentFile) { // contentFile | ||
contentFile = newFile; | ||
expect(String(newFile.contents)).to.be.equal( | ||
'console.log(\'Hello\');' + | ||
'\n\nconsole.log(\'World\');\n\n' + | ||
'//# sourceMappingURL=file.js.map' | ||
); | ||
} else { // mapFile | ||
expect(String(newFile.contents)).to.be.equal( | ||
"{\n " + | ||
"\"version\": 3,\n " + | ||
"\"file\": \"file.js\",\n " + | ||
"\"sources\": [\n " + | ||
"\"file1.js\",\n " + | ||
"\"file2.js\"\n ],\n " + | ||
"\"names\": [],\n " + | ||
"\"mappings\": \"AAAA;;ACAA\",\n " + | ||
"\"sourcesContent\": [\n " + | ||
"\"console.log('Hello');\",\n " + | ||
"\"console.log('World');\"\n " + | ||
"]\n" + | ||
"}"); | ||
done(); | ||
} | ||
}); | ||
stream.write(file1); | ||
stream.write(file2); | ||
stream.end(); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11493
232