在VS Code中configurationtypescript debug的launch.json
这是VS Code的launch.jsonconfiguration文件。
{ "version": "0.2.0", "configurations": [{ "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceRoot}/src/server/server.ts", "cwd": "${workspaceRoot}", "outDir": "${workspaceRoot}/build/server", "sourceMaps": true, "stopOnEntry": false, "smartStep": true, "runtimeArgs": ["--nolazy"] }, { "type": "node", "request": "attach", "name": "Attach to Process", "port": 5858, "outFiles": [], "sourceMaps": true }] }
我不知道为什么我只能在server.ts文件上放置断点,即使代码是用sourcemaps编译的。
我使用gulp-typescript编译代码如下
var tsProject = p.typescript.createProject(cfg.tsconfig); return gulp.src(cfg.src) .pipe(p.plumber({ errorHandler: p.notify.onError('Typescript SERVER error: <%= error.message %>') })) .pipe(p.sourcemaps.init({ loadMaps: true })) .pipe(tsProject()) .pipe(p.sourcemaps.write('./')) .pipe(gulp.dest(cfg.dest)) .pipe(p.notify({ title: 'Typescript SERVER', message: 'Server compiled!', onLast: true }));
这是我的tsconfig.json
{ "compilerOptions": { "target": "ES5", "module": "commonjs", "moduleResolution": "node", "noEmitOnError": true, "noImplicitAny": false, "experimentalDecorators": true, "emitDecoratorMetadata": true, "sourceMap": true, "noLib": false, "outDir": "./../../build", "rootDir": "./../" }, "exclude": [ "./../client" ] }
- 在“module”全局variables上运行grunt-typescript时,angular-mock和node.js发生冲突
- 如何为具有构造函数的复杂外部commonjs模块(如imap)编写TypeScript声明文件?
- 如何连线Angular2 + Webpack + Node + Express?
- Angular2 http向其他端口上的nodejs服务器发送请求
- Angular 2testing不能加载自定义包
- Express-session和express-socket.io-session在angular2 / typecript环境中不起作用
- TypeScript编译器很慢(6-10s)
- 翻译require()语法来导入语法节点js
- 你用什么来使JavaScript更像C#一样?