在react中使用react-vant浏览器适配出错postcssconfigts cannot be compiled under --isolatedModules because it is considered a global script file Add an import export or an empty export statement to make it a modul
这个错误是因为在使用react-vant时,postcss.config.ts被当作全局脚本文件编译,而不是作为一个模块。为了解决这个问题,你可以在postcss.config.ts文件的顶部加上一个空的export语句,例如:
export {};
这样就能将postcss.config.ts文件标记为一个模块,从而解决这个错误。
原文地址: https://www.cveoy.top/t/topic/iW64 著作权归作者所有。请勿转载和采集!