项目场景: 在使用webpack作为打包工具时需要从项目目录中导入json文件 问题描述 会报错:Cannot find module ‘./assets/test.json’. Did you mean to set the ‘moduleResolution’ option to ‘node’, or to add aliases to the ‘paths’ option? 解决方案: 在custom.d.ts中添加描述 declare module "*.json" { const content: any; export default content; }