package
package.json
{
"name": "demo",
"version": "0.1.0",
"main": "",
"scripts": {
"start": "ts-node src/main.ts"
},
"license": "MIT",
"dependencies": {},
"devDependencies": {
"@types/node": "^17.0.2",
"ts-node": "^10.4.0",
"tslib": "^2.3.1",
"typescript": "^4.5.4"
}
}
tsconfig
tsconfig.json
{
"compilerOptions": {
"lib": [
"es6"
],
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"resolveJsonModule": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"sourceMap": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
参考: