diff --git a/lib/loader.js b/lib/loader.js index 561cf5a1..edf273fd 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -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"); @@ -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); diff --git a/test/sourceMapTest.js b/test/sourceMapTest.js index 9c29729a..39401e95 100644 --- a/test/sourceMapTest.js +++ b/test/sourceMapTest.js @@ -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 }] @@ -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 }] @@ -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 }]