Merge pull request #1797 from nilennoct/master

Set charset as 'utf-8' in sourcemap plugin
This commit is contained in:
Tobias Koppers 2015-12-24 12:06:10 +01:00
commit 1f58c557c1
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ EvalSourceMapDevToolModuleTemplatePlugin.prototype.apply = function(moduleTempla
}
sourceMap.sourceRoot = "";
sourceMap.file = module.id + ".js";
var footer = self.sourceMapComment.replace(/\[url\]/g, "data:application/json;base64," + new Buffer(JSON.stringify(sourceMap)).toString("base64"));
var footer = self.sourceMapComment.replace(/\[url\]/g, "data:application/json;charset=utf-8;base64," + new Buffer(JSON.stringify(sourceMap)).toString("base64"));
source.__EvalSourceMapDevToolData = new RawSource("eval(" + JSON.stringify(content + footer) + ");");
return source.__EvalSourceMapDevToolData;
});

View File

@ -152,7 +152,7 @@ SourceMapDevToolPlugin.prototype.apply = function(compiler) {
return JSON.stringify(sourceMap);
})
.replace(/\[url\]/g, function() {
return "data:application/json;base64," +
return "data:application/json;charset=utf-8;base64," +
new Buffer(JSON.stringify(sourceMap)).toString("base64");
})
);