有时在 .ts 文件中需要通过 import config from 'config.json' 方式来导入写在 json 中的配置信息。
我们需要在 tsconfig.json 文件中开启一下配置:
{
"compilerOptions": {
"resolveJsonModule": true
}
} 有时在 .ts 文件中需要通过 import config from 'config.json' 方式来导入写在 json 中的配置信息。
我们需要在 tsconfig.json 文件中开启一下配置:
{
"compilerOptions": {
"resolveJsonModule": true
}
}