Skip to content

Commit 326c817

Browse files
committed
Merge pull request webpack#2340 from jaredleechn/webpack-1
[fix] set charset as 'utf-8' in sourcemap plugin in branch webpack-1,…
2 parents 006d595 + 5199902 commit 326c817

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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)