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 8, 2017
1 parent 2ee7552 commit 46705ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/loader.js
Expand Up @@ -16,13 +16,17 @@ module.exports = function(content, map) {
var root = query.root;
var moduleMode = query.modules || query.module;
var camelCaseKeys = query.camelCase || query.camelcase;
var sourceMap = query.sourceMap || false;
var resolve = createResolver(query.alias);

if(map !== null && typeof map !== "string") {
if(sourceMap && map !== null && typeof map !== "string") {
map = JSON.stringify(map);
} else {
map = null;
}

processCss(content, map, {
moduleMode: moduleMode,
mode: moduleMode ? "local" : "global",
from: loaderUtils.getRemainingRequest(this),
to: loaderUtils.getCurrentRequest(this),
Expand Down

0 comments on commit 46705ba

Please sign in to comment.