dravenww / vite-bugs

记录在vite使用中遇到的一些坑
1 stars 0 forks source link

ant-design-mobile ===> can't not find varible: require #1

Open dravenww opened 3 years ago

dravenww commented 3 years ago

https://github.com/ant-design/ant-design-mobile/issues/3784

antd内部混用require和import导致

dravenww commented 3 years ago

解决:

https://vitejs.dev/config/#build-commonjsoptions

code:

build: { commonjsOptions: { transformMixedEsModules: true } }