我正在尝试创建一个TypeScript服务器端(示例代码 import mongoose from 'mongoose';
),我知道在此之前应该初始化systemjs,但是我不知道如何在服务器端脚本中进行初始化。
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts"
,然后运行typings install
。 - Amid