Closed simonwong closed 2 years ago
原来使用正则匹配的方式只能解析 export default {}; 类似这样的代码结构。 有一些特殊需求,比如改成 export default {} as const; 这种加了 const 断言的文件就解析不出来了。
export default {};
export default {} as const;
所以将获取语言文件对象的方式改成 AST 解析来适应各种场景。
All committers have signed the CLA.
LGTM
原来使用正则匹配的方式只能解析
export default {};
类似这样的代码结构。 有一些特殊需求,比如改成export default {} as const;
这种加了 const 断言的文件就解析不出来了。所以将获取语言文件对象的方式改成 AST 解析来适应各种场景。