我试图在我的项目中使用导入语法,即试图使用graphql + node + babel + express + typescript。例如,当我尝试使用apollo-client-express程序包时,就会显示错误。我知道打字稿有自己的导入语法,例如*
。真正的事情是我无法解决问题,这是由于babel或打字稿配置还是其他原因引起的?这是我的
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"moduleResolution": "node",
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2018",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./src",
"incremental": true,
"skipLibCheck": true,
"esModuleInterop": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dist",
"*.js"
]
}
{ "presets": ["@babel/preset-env"] }