描述:
Ant Design Pro集成了很多功能,比如国际化。
国际化的代码在目录路径:/src/locales下:
由于开发的小项目只针对国内用户,没必要做国际化,在package.json中找到i18n-remove,这里提供移除国际化的脚本
执行i18n-remove报错了
解决方案:
在终端先输入以下代码:
yarn add eslint-config-prettier --dev yarn add eslint-plugin-unicorn --dev
再找到 项目名称\node_modules\@umijs\lint\dist\config\eslint\index.js这个文件将es2022:true注释掉,否则还会报错
再次执行i18n-remove,成功移除国际化,再将locals目录手动删除
在终端再次输入yarn run start 启动项目,看看项目是否能正常运行。