如何应用特定的“编译”仅到特定文件? (tsconfig.json)
是否只能将特定的TSCONFIG选项应用于1个文件?
以下是我的tsconfig.json,
{
...
"compilerOptions": {
...
"keyofStringsOnly": false,
"resolveJsonModule": true,
"esModuleInterop": true
},
...
}
我想仅在指定组件文件中使用选项“ resolvejsonmodule”和“ esmoduleop”。
有什么办法吗?谢谢。
Is it possible that apply specific tsconfig options to 1 file only?
Below is my tsconfig.json
{
...
"compilerOptions": {
...
"keyofStringsOnly": false,
"resolveJsonModule": true,
"esModuleInterop": true
},
...
}
I would like to use option "resolveJsonModule" and "esModuleInterop" in specify component file only.
Is there any way for this? thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您必须在目录内创建一个新的tsconfig.ts文件,在您的特别内容文件中。您可以使用扩展,如果您可以重复使用原始选项,也可以修改其上的一些选项:
示例:
注意:也许您需要重新启动代码编辑器以再次读取Typescript条件。
Yes, you must create a new tsconfig.ts file inside the directory where is your especial file. You can use extends if you can reuse original options, or you can modify some options on it:
Example:
NOTE: Maybe you need to restart your code editor to force read again typescript conditions.