我有一个简单的函数:
const showUTF8Text = text => `Funkcja wyświetla tekst: ${text}`;
,用babel编译后,我收到:
var showUTF8Text = function showUTF8Text(text) {
return "Funkcja wyuFFFDwietla tekst: " + text;
};
如何防止Babel从编码保持原来的字符串?
这里建议:https://github.com/babel/babel/issues/9804#issuecomment-480075309
将此添加到babel配置:
"generatorOpts": {
"jsescOption": {
"minimal": true
}
}
有关jsesc
选项的更多信息请参见其README: https://github.com/mathiasbynens/jsesc#minimal