手动编写了一个vscode打字稿编译任务:http://code.visualstudio.com/docs/languages/typescript#_transpiling-typescript-into-javascript。
运行构建(Ctrl + Shift + B)后,vscode显示tsc具有未知编码的内容,请参阅屏幕: http://prnt.sc/dz60uu
有什么想法吗?
tsconfig.json:
{
"files": [
],
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
],
"compilerOptions": {
"noImplicitAny": true,
"target": "es5",
"module":"commonjs",
"removeComments": true,
"preserveConstEnums": true,
"out": "dist/index.js",
"sourceMap": true
}
}
答案 0 :(得分:2)
此命令修复了编码问题:
npm install -g typescript