Skip to content

Commit

Permalink
Set charset as 'utf-8' in sourcemap plugin
Browse files Browse the repository at this point in the history
by adding 'charset=utf-8;'.
  • Loading branch information
nilennoct committed Dec 24, 2015
1 parent 22c6161 commit af4c2e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/EvalSourceMapDevToolModuleTemplatePlugin.js
Expand Up @@ -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;
});
Expand Down
2 changes: 1 addition & 1 deletion lib/SourceMapDevToolPlugin.js
Expand Up @@ -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");
})
);
Expand Down

0 comments on commit af4c2e8

Please sign in to comment.