Skip to content
Merged
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
9 changes: 2 additions & 7 deletions lib/loader.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 path = require("path");
var loaderUtils = require("loader-utils");
var processCss = require("./processCss");
var getImportPrefix = require("./getImportPrefix");
Expand Down Expand Up @@ -97,13 +96,9 @@ module.exports = function(content, map) {
map = result.map;
if(map.sources) {
map.sources = map.sources.map(function(source) {
source = source.split("!").pop();
var p = path.relative(query.context || this.options.context, source).replace(/\\/g, "/");
if(p.indexOf("../") !== 0)
p = "./" + p;
return "/" + p;
return source.split("!").pop();
}, this);
map.sourceRoot = "webpack://";
map.sourceRoot = "";
}
map.file = map.file.split("!").pop();
map = JSON.stringify(map);
Expand Down
12 changes: 6 additions & 6 deletions test/sourceMapTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe("source maps", function() {
file: 'test.css',
mappings: 'AAAA,SAAS,SAAS,EAAE',
names: [],
sourceRoot: 'webpack://',
sources: [ '/./folder/test.css' ],
sourceRoot: '',
sources: [ '/folder/test.css' ],
sourcesContent: [ '.class { a: b c d; }' ],
version: 3
}]
Expand All @@ -38,8 +38,8 @@ describe("source maps", function() {
file: 'test.css',
mappings: 'AAAA,SAAS,SAAS,EAAE',
names: [],
sourceRoot: 'webpack://',
sources: [ '/../../folder/test.css' ],
sourceRoot: '',
sources: [ '/folder/test.css' ],
sourcesContent: [ '.class { a: b c d; }' ],
version: 3
}]
Expand All @@ -55,8 +55,8 @@ describe("source maps", function() {
file: 'test.scss',
mappings: 'AAAA,SAAS,SAAS,EAAE',
names: [],
sourceRoot: 'webpack://',
sources: [ '/./folder/test.scss' ],
sourceRoot: '',
sources: [ '/folder/test.scss' ],
sourcesContent: [ '.class { a: b c d; }' ],
version: 3
}]
Expand Down