Is it possible to include a json file when using TypeScript with a tsconfig.json file?

前端 未结 3 395
温柔的废话
温柔的废话 2021-01-03 18:45

Is there any way to have the TypeScript compiler also copy content files that don\'t have a ts or tsx extension to the output directory?

For example, my tsconfig.jso

3条回答
  •  臣服心动
    2021-01-03 19:05

    This can be achieved by setting "resolveJsonModule": true in the compiler options and adding "source-path/**/*.json" to the include array in the tsconfig.json

提交回复
热议问题