记录一个错误: Cannot find module ‘./index.module.less‘ or its corresponding type declarations. TS2307
记录一个错误: Cannot find module ‘./index.module.less’ or its corresponding type declarations. TS2307
起初以为是craco的less配置错误了,后来一看错误是ts的,因为我是create-react-app + typescript + craco,不过这个错误只和typescript有关系,ts不认识less文件。
解决办法,全局声明文件react-app-env.d.ts添加
/// <reference
原创
2021-06-17 00:14:02 ·
11806 阅读 ·
2 评论