之前找了好久才找到答案。方便和我有同样问题的朋友,也为了我以后的使用。写一篇短文。答案很简单,你只需要配置tsconfig.json文件即可,但是很遗憾的告诉你,在官方配置文档中找不到对应的字段答案来自于文档的更新版本官网Typescript2.9.即添加compilerOptions配置项"resolveJsonModule":true。我的tsconfig.json如下,"allowSyntheticDefaultImports":true,"target":"es2017","sourceMap":true,"outDir":"./dist","baseUrl":"./","incremental":true,"resolveJsonModule":真的,}}
