请教一下@ant-design/moment-webpack-plugin插件问题 #11491
Unanswered
jiajiaxing1
asked this question in
Q&A
Replies: 1 comment 4 replies
-
这样试试,如果还找不到 dayjs ,就显示安装一下 dayjs 。 chainWebpack(memo, args) {
memo.plugin('AntdMomentWebpackPlugin').use(new require('@ant-design/moment-webpack-plugin')());
}, |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
刚才umi3升级成umi4之后,把antd也升级到5了
在兼容dayjs的时候,按照官方文档,我打算使用import AntdMomentWebpackPlugin from '@ant-design/moment-webpack-plugin';这个插件,参考官方文档https://ant.design/docs/react/migration-v5-cn#%E6%9B%BF%E6%8D%A2-dayjs-%E8%AF%AD%E8%A8%80%E5%8C%85
但是配置之后报错
配置如下 config/config.ts
import AntdMomentWebpackPlugin from '@ant-design/moment-webpack-plugin';
chainWebpack(memo, args) {
memo.plugin('AntdMomentWebpackPlugin').use(new AntdMomentWebpackPlugin());
},
报错信息如下
./node_modules/@ant-design/pro-field/es/components/DatePicker/index.js:7:0-49
Module not found: Error: Can't resolve 'dayjs/plugin/weekOfYear' in '/Users/jiajiaxing/Desktop/zhengan/sovell-mage-management-handlefraud-umi4/node_modules/@ant-design/pro-field/es/components/DatePicker'
error - ./node_modules/@ant-design/pro-field/es/components/FromNow/index.js:6:0-53
error - ./node_modules/@ant-design/pro-field/es/index.js:45:0-57
error - ./node_modules/@ant-design/pro-field/es/index.js:46:0-43
error - ./node_modules/@ant-design/pro-field/es/index.js:47:0-49
error - ./node_modules/@ant-design/pro-field/es/index.js:48:0-43
error - ./node_modules/@ant-design/pro-field/es/index.js:49:0-49
error - ./node_modules/@ant-design/pro-utils/es/conversionMomentValue/index.js:3:0-55
error - ./node_modules/@ant-design/pro-utils/es/parseValueToMoment/index.js:2:0-63
Module not found: Error: Can't resolve 'dayjs/plugin/relativeTime' in '/Users/jiajiaxing/Desktop/zhengan/sovell-mage-management-handlefraud-umi4/node_modules/@ant-design/pro-field/es/components/FromNow'
Module not found: Error: Can't resolve 'dayjs/plugin/advancedFormat' in '/Users/jiajiaxing/Desktop/zhengan/sovell-mage-management-handlefraud-umi4/node_modules/@ant-design/pro-field/es'
Module not found: Error: Can't resolve 'dayjs/plugin/isoWeek' in '/Users/jiajiaxing/Desktop/zhengan/sovell-mage-management-handlefraud-umi4/node_modules/@ant-design/pro-field/es'
Module not found: Error: Can't resolve 'dayjs/plugin/localeData' in '/Users/jiajiaxing/Desktop/zhengan/sovell-mage-management-handlefraud-umi4/node_modules/@ant-design/pro-field/es'
Module not found: Error: Can't resolve 'dayjs/plugin/weekday' in '/Users/jiajiaxing/Desktop/zhengan/sovell-mage-management-handlefraud-umi4/node_modules/@ant-design/pro-field/es'
Module not found: Error: Can't resolve 'dayjs/plugin/weekOfYear' in '/Users/jiajiaxing/Desktop/zhengan/sovell-mage-management-handlefraud-umi4/node_modu
Beta Was this translation helpful? Give feedback.
All reactions