I had a problem with the release this afternoon. I didn’t understand the mobile error for a long time, but later I went around and found it was antD
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
'antd-mobile': 'antd-mobile'
}
Copy the code
As mentioned above, when we configured webpack, after CDN was introduced, the variable under Window was called ANTD-mobile. This error should be the problem that window. antD-mobile could not recognize
Then I just added a transform window.antdmobile = window[‘antd-mobile’] to the HTML to rename AntdMobile.
Also change the webPack configuration to ‘antD-Mobile ‘: ‘AntdMobile’
Also, antD-Mobile has no maintenance! Strongly not recommended!!
I wasn’t going to use it anyway!! Tried to encounter pit, *****