Skip to content

Commit

Permalink
Fixed: generate source maps when they are actually requested.
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Apr 11, 2017
1 parent e8d3dc2 commit ac1eb9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/loader.js
Expand Up @@ -32,7 +32,8 @@ module.exports = function(content, map) {
to: loaderUtils.getCurrentRequest(this),
query: query,
minimize: this.minimize,
loaderContext: this
loaderContext: this,
sourceMap: sourceMap
}, function(err, result) {
if(err) return callback(err);

Expand Down
4 changes: 2 additions & 2 deletions lib/processCss.js
Expand Up @@ -191,12 +191,12 @@ module.exports = function processCss(inputSource, inputMap, options, callback) {
// we need a prefix to avoid path rewriting of PostCSS
from: "/css-loader!" + options.from,
to: options.to,
map: {
map: options.sourceMap ? {
prev: inputMap,
sourcesContent: true,
inline: false,
annotation: false
}
} : null
}).then(function(result) {
callback(null, {
source: result.css,
Expand Down

0 comments on commit ac1eb9a

Please sign in to comment.