mirror of https://github.com/webpack/webpack.git
Merge pull request #1797 from nilennoct/master
Set charset as 'utf-8' in sourcemap plugin
This commit is contained in:
commit
1f58c557c1
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
})
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue