Skip to content

Commit

Permalink
Pass inputSourceMap to the next loader in chain
Browse files Browse the repository at this point in the history
In webpack3 this means that we'll be able to see original sources
referenced by source maps, not the files transpiled by
webpack-bem-loader.
  • Loading branch information
tsufiev committed Mar 30, 2018
1 parent 2293096 commit 0074a7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const path = require('path'),
loaderUtils = require('loader-utils'),
getGenerators = require('./generators');

module.exports = function(source) {
module.exports = function(source, inputSourceMap) {
this.cacheable && this.cacheable();

const callback = this.async(),
Expand Down Expand Up @@ -159,6 +159,6 @@ module.exports = function(source) {
});

Promise.all(allPromises)
.then(() => callback(null, result.toString()))
.then(() => callback(null, result.toString(), inputSourceMap))
.catch(callback);
};

0 comments on commit 0074a7a

Please sign in to comment.