Skip to content

Instantly share code, notes, and snippets.

@activebiz
Last active January 31, 2016 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save activebiz/b6fa230d7123d6c3d5a0 to your computer and use it in GitHub Desktop.
Save activebiz/b6fa230d7123d6c3d5a0 to your computer and use it in GitHub Desktop.
VSCode & Chrome debugger (Plugin) with typescript.
gulp.task('tscompile', function (done) {
return gulp.src('app/**/*.ts')
.pipe(sourcemaps.init())
.pipe(ts({
target: "es5",
module: "system",
emitDecoratorMetadata: true,
experimentalDecorators: true
})).js
.pipe(sourcemaps.write('.',{ includeContent: true, sourceRoot: "/" }))
.pipe(gulp.dest("app"));
});
{
"version": "0.1.0",
"configurations": [
{
// Right click the Chrome shortcut, and select properties
// In the "target" field, append --remote-debugging-port=9222
"name": "Attach",
"type": "chrome",
"request": "attach",
"webRoot": "./app",
"port": 9222,
"sourceMaps": true,
"diagnosticLogging": false
},
{
"name": "Launch app",
"type": "chrome",
"request": "launch",
"url": "https://myapp", //Change to whatever you homepage is
"runtimeArgs": [
"--new-window", //Open in new window
"--user-data-dir=C:/temp/", //Can be any directory. Makes chrome load in a different directory so that it opens in a new instance.
"--remote-debugging-port=9222" //Open in port 9222 (standard chrome debug port)
],
"preLaunchTask": "tscompile",
"webRoot": "./app", //The directory that contains js, ts and map files
"sourceMaps": true,
"diagnosticLogging": false
}
]
}
The structure of the app looks as follows:
wwwsrc (folder)
- build (folder)
-tasks (folder)
-gulpfile.js
- app (folder)
- app.ts
- dashboard (folder)
- dashboard.ts
index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment