Typescript debugging in visual studio 2015 no longer works with Angular 2 2.0.0-rc.1

After upgrading to Angular 2 rc1 typescript, debugging in visual studio 2015 stopped working. I added to the meta tag, as in previous versions, but now all other problems now require "require" - this is undefined. Could anyone get this job yet?

here is my system.config.js file

(function (global) { // map tells the System loader where to look for things var map = { 'app': 'app', // 'dist', 'rxjs': 'node_modules/rxjs', '@angular': 'node_modules/@angular' }; // packages tells the System loader how to load when no filename // and/or no extension var packages = { 'app': { main: 'main.js', defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' }, }; var meta = { '*.js': { scriptLoad: true } //this allows TS debugging in VS }; var packageNames = [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router', '@angular/router-deprecated', '@angular/testing', '@angular/upgrade', ]; // add package entries for angular packages in // the form '@angular/common': { main: 'index.js', // defaultExtension: 'js' } packageNames.forEach(function (pkgName) { packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; }); var config = { meta: meta, map: map, packages: packages } // filterSystemConfig - index.html chance to modify config before // we register it. if (global.filterSystemConfig) { global.filterSystemConfig(config); } System.config(config); })(this); 
+6
source share
2 answers

The workaround is to run the following command in cmd for your project folder

 >tsc 

but first make sure you have the typescript compiler installed

 $ npm install typescript-compiler 
0
source

I have VS2015 angular2 debugging working again using Gulp. Have you tried Gulp? The following instruction was helpful: http://www.codeproject.com/Articles/1087605/Angular-typescript-configuration-and-debugging-for .

I basically did this:

  • add gulp to package.json

      "devDependencies": { "gulp": "^3.9.1", ... } 
  • add gulpfile.js to the project root directory (see codeProject link above for content)

  • add meta when calling Sytem.config

      System.config({ meta: { '*.js': { scriptLoad: true } }, packages: { app: { format: 'register', defaultExtension: 'js' } } }); 
    • restart "npm install"

    • Follow the line: “Right-click gulpfile.js and select“ Task Launcher. ”Right-click moveToLibs and select“ Run ”

0
source

All Articles