Skip to content

Commit 346b58a

Browse files
committed
Use previous source map and don't inline the source maps.
This fixes source mapping when used with sass-loader. Also, we don't want to map to the postcss generated source, we want to map to the pre-postcss source.
1 parent 0d6db5e commit 346b58a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
var loaderUtils = require('loader-utils');
22
var postcss = require('postcss');
33

4-
module.exports = function (source) {
4+
module.exports = function (source, map) {
55
if ( this.cacheable ) this.cacheable();
66

77
var file = loaderUtils.getRemainingRequest(this);
88
var params = loaderUtils.parseQuery(this.query);
99

10-
var opts = { from: file, to: file };
10+
var opts = { from: file, to: file, map: { prev: map, inline: false } };
1111
if ( params.safe ) opts.safe = true;
1212

1313
var processors = this.options.postcss;

0 commit comments

Comments
 (0)