Tot*_*.js 7 typescript tsconfig
我想知道什么更好,在tsconfig中使用“文件”与“包含”的优缺点是什么?
我不太喜欢include模式,因为只是将所有ts文件包括在src文件夹中,现在我可能想要这样。
我喜欢“文件”方法,因为我可以指向入口文件并仅加载该文件所需的所有内容。
我在webpack中使用打字稿。我猜入口点是在webpack中定义的,所以也不需要在打字稿中定义吗?
我尝试使用“文件”,但似乎无法设置文件夹以查找自定义类型定义:带有tsconfig和“ files”的打字稿=>找不到导入图像模块
Dmi*_*sky 17
有两个例子的tsconfig.json打字稿,酮与官方网站上介绍"files"的财产,另一个与"include"和"exclude"指定的属性:
使用
"files"物业Run Code Online (Sandbox Code Playgroud){ "compilerOptions": { // irrelevant }, "files": [ "core.ts", "sys.ts", "types.ts", "scanner.ts", "parser.ts", "utilities.ts", "binder.ts", "checker.ts", "emitter.ts", "program.ts", "commandLineParser.ts", "tsc.ts", "diagnosticInformationMap.generated.ts" ] }使用
"include"和"exclude"属性Run Code Online (Sandbox Code Playgroud){ "compilerOptions": { // irrelevant }, "include": [ "src/**/*" ], "exclude": [ "node_modules", "**/*.spec.ts" ] }
因此,基本上,"files"用于直接通过路径指定单独的文件,而"include"和"exclude"用于定位文件或文件夹等的集合或组。
| 归档时间: |
|
| 查看次数: |
654 次 |
| 最近记录: |