【发布时间】:2021-05-18 11:27:54
【问题描述】:
我正在使用 Microsoft 的 Typescript Node Starter Project 创建 Node/Express API - https://github.com/microsoft/TypeScript-Node-Starter
当我构建项目时,它会在我的所有代码中插入分号。不是 /dist 中的编译代码,而是 /src 中我不想要分号的源代码。
package.json 有以下脚本(略)
"scripts": {
...
"build": "npm run build-ts && npm run lint && npm run copy-static-assets",
"build-ts": "tsc",
"copy-static-assets": "ts-node copyStaticAssets.ts",
"lint": "tsc --noEmit && eslint \"**/*.{js,ts}\" --quiet --fix",
...
},
这是我的 tsconfig.json 的内容
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "es6",
"lib": ["es2019", "dom"],
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*",
"src/types/*"
]
}
},
"include": [
"src/**/*"
]
}
我可以使用一个标志来关闭此行为吗?
【问题讨论】:
标签: node.js typescript tsc