Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var SourceMap = require("source-map");
var fs = require("fs");
var path = require("path");
var async = require("async");
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
],
"dependencies": {
"async": "^0.9.0",
"loader-utils": "~0.2.2",
"source-map": "~0.1.33"
"loader-utils": "~0.2.2"
}
}
1 change: 0 additions & 1 deletion test/fixtures/charset-inline-source-map.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/fixtures/external-source-map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
with SourceMap
//#sourceMappingURL=external-source-map.map
// comment
// comment
2 changes: 1 addition & 1 deletion test/fixtures/external-source-map2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
with SourceMap
//#sourceMappingURL=data/external-source-map2.map
// comment
// comment
1 change: 0 additions & 1 deletion test/fixtures/inline-source-map.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/fixtures/missing-source-map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
with SourceMap
//#sourceMappingURL=missing-source-map.map
// comment
// comment
2 changes: 1 addition & 1 deletion test/fixtures/missing-source-map2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
with SourceMap
//#sourceMappingURL=missing-source-map2.map
// comment
// comment
1 change: 0 additions & 1 deletion test/fixtures/multi-source-map.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion test/fixtures/normal-file.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
without SourceMap
18 changes: 9 additions & 9 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("source-map-loader", function() {
execLoader(path.join(__dirname, "fixtures", "normal-file.js"), function(err, res, map, deps, warns) {
should.equal(err, null);
warns.should.be.eql([]);
should.equal(res, "without SourceMap"),
should.equal(res, ""),
should.equal(map, null);
deps.should.be.eql([]);
done();
Expand All @@ -54,7 +54,7 @@ describe("source-map-loader", function() {
execLoader(path.join(__dirname, "fixtures", "inline-source-map.js"), function(err, res, map, deps, warns) {
should.equal(err, null);
warns.should.be.eql([]);
should.equal(res, "with SourceMap\n// comment"),
should.equal(res, "// comment"),
map.should.be.eql({
"version":3,
"file":"inline-source-map.js",
Expand All @@ -72,7 +72,7 @@ describe("source-map-loader", function() {
execLoader(path.join(__dirname, "fixtures", "external-source-map.js"), function(err, res, map, deps, warns) {
should.equal(err, null);
warns.should.be.eql([]);
should.equal(res, "with SourceMap\n// comment"),
should.equal(res, "with SourceMap\n// comment\n"),
map.should.be.eql({
"version":3,
"file":"external-source-map.js",
Expand All @@ -92,7 +92,7 @@ describe("source-map-loader", function() {
execLoader(path.join(__dirname, "fixtures", "external-source-map2.js"), function(err, res, map, deps, warns) {
should.equal(err, null);
warns.should.be.eql([]);
should.equal(res, "with SourceMap\n// comment"),
should.equal(res, "with SourceMap\n// comment\n"),
map.should.be.eql({
"version":3,
"file":"external-source-map2.js",
Expand All @@ -113,7 +113,7 @@ describe("source-map-loader", function() {
execLoader(path.join(__dirname, "fixtures", "multi-source-map.js"), function (err, res, map, deps, warns) {
should.equal(err, null);
warns.should.be.eql([]);
should.equal(res, "with SourceMap\nanInvalidDirective = \"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+\" */\";\n// comment"),
should.equal(res, "anInvalidDirective = \"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+\" */\";\n// comment"),
map.should.be.eql({
"version": 3,
"file": "inline-source-map.js",
Expand All @@ -133,7 +133,7 @@ describe("source-map-loader", function() {
warns.should.be.eql([
"Cannot find SourceMap 'missing-source-map.map': Error: File not found"
]);
should.equal(res, "with SourceMap\n//#sourceMappingURL=missing-source-map.map\n// comment"),
should.equal(res, "with SourceMap\n//#sourceMappingURL=missing-source-map.map\n// comment\n"),
should.equal(map, null);
deps.should.be.eql([]);
done();
Expand All @@ -145,7 +145,7 @@ describe("source-map-loader", function() {
warns.should.be.eql([
"Cannot find source file 'missing-source-map2.txt': Error: File not found"
]);
should.equal(res, "with SourceMap\n// comment"),
should.equal(res, "with SourceMap\n// comment\n"),
map.should.be.eql({
"version":3,
"file":"missing-source-map2.js",
Expand All @@ -166,7 +166,7 @@ describe("source-map-loader", function() {
execLoader(path.join(__dirname, "fixtures", "charset-inline-source-map.js"), function(err, res, map, deps, warns) {
should.equal(err, null);
warns.should.be.eql([]);
should.equal(res, "with SourceMap\n// comment"),
should.equal(res, "// comment"),
map.should.be.eql({
"version":3,
"file":"charset-inline-source-map.js",
Expand All @@ -180,4 +180,4 @@ describe("source-map-loader", function() {
done();
});
});
});
});