Skip to content

Commit af4c2e8

Browse files
committed
Set charset as 'utf-8' in sourcemap plugin
by adding 'charset=utf-8;'.
1 parent 22c6161 commit af4c2e8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/EvalSourceMapDevToolModuleTemplatePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ EvalSourceMapDevToolModuleTemplatePlugin.prototype.apply = function(moduleTempla
5757
}
5858
sourceMap.sourceRoot = "";
5959
sourceMap.file = module.id + ".js";
60-
var footer = self.sourceMapComment.replace(/\[url\]/g, "data:application/json;base64," + new Buffer(JSON.stringify(sourceMap)).toString("base64"));
60+
var footer = self.sourceMapComment.replace(/\[url\]/g, "data:application/json;charset=utf-8;base64," + new Buffer(JSON.stringify(sourceMap)).toString("base64"));
6161
source.__EvalSourceMapDevToolData = new RawSource("eval(" + JSON.stringify(content + footer) + ");");
6262
return source.__EvalSourceMapDevToolData;
6363
});

lib/SourceMapDevToolPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ SourceMapDevToolPlugin.prototype.apply = function(compiler) {
152152
return JSON.stringify(sourceMap);
153153
})
154154
.replace(/\[url\]/g, function() {
155-
return "data:application/json;base64," +
155+
return "data:application/json;charset=utf-8;base64," +
156156
new Buffer(JSON.stringify(sourceMap)).toString("base64");
157157
})
158158
);

0 commit comments

Comments
 (0)