我有一个JSII项目,在package.json
中包含以下JSII部分:
"jsii": {
"outdir": "dist",
"targets": {
"python": {
"distName": "pipeline-github-token",
"module": "pipeline_github_token"
}
},
"tsc": {
"outDir": "build",
"rooDir": "src"
}
}
构建期间,JSII生成tsconfig.json
文件,其中包含以下部分:
"include": [
"**/*.ts"
],
"exclude": [
"node_modules",
"build/**/*.ts"
],
但是看起来TypeScript仍然尝试处理node_modules
内部的文件,我收到了如下错误
node_modules/jest-snapshot/build/index.d.ts:179:9 - error TS1005: ',' expected.
179 [hint?: string, fromPromise?: boolean]
~
node_modules/jest-snapshot/build/index.d.ts:179:30 - error TS1005: ',' expected.
179 [hint?: string, fromPromise?: boolean]
~
node_modules/jest-snapshot/build/index.d.ts:179:31 - error TS1134: Variable declaration expected.
179 [hint?: string, fromPromise?: boolean]
~
node_modules/jest-snapshot/build/index.d.ts:179:40 - error TS1005: ',' expected.
179 [hint?: string, fromPromise?: boolean]
~
node_modules/jest-snapshot/build/index.d.ts:180:1 - error TS1109: Expression expected.
180 >;
~
node_modules/jest-snapshot/build/index.d.ts:180:2 - error TS1109: Expression expected.
为什么TypeScript在编译过程中不忽略/排除node_module
内容?
1条答案
按热度按时间g9icjywg1#
请看以下内容:
https://github.com/aws/jsii/issues/3864
您可能使用了与jsii不兼容的@types/jest版本。当前版本的jsii与旧版本的typescript兼容。