Exploring and Migrating to TypeScript

Sign in to queue

The Discussion

  • User profile image
    DashNYC

    Thanks for the tip: close your compiled files in VS or they won't be re-built @ 25:00

    This was driving me crazy.

     

  • User profile image
    Scheelings

    Thanks for this great demo. I have created a similar project in VS2017 to test it and everything works great.

    I have 1 question though about sourceMaps, which I have set to true in the tsconfig.json file. This generates the *.js.map files in the wwwroot/scripts folder. But when I try to debug a *.ts file in the Developer toolbar in Chrome or MSIE (without using VS2017 debugging) it is not able to load the *.ts file, because the *.js.map file maps to the localhost/Client folder which does not exist.
    How would you solve this problem?

    Thanks,
    Danny

  • User profile image
    Treehouse​SmashDev

    @Scheelings: As you've discovered, in an ASP.NET Core application, only static files located in the wwwroot folder will get served to clients. To get around having to move your TypeScript source files into the wwwroot folder, try setting the "inlineSourceMap" and "inlineSources" TypeScript compiler options both to "true". Doing this will make your TypeScript source code available to the browser developer tools.

    Ideally, you wouldn't enable those compiler options when building the production version of your application. Having a more robust front end build process/workflow using gulp/grunt/webpack would help you manage this.

    Thanks ~James

  • User profile image
    Scheelings

    @Treehouse​SmashDev, thanks for the tips!

  • User profile image
    Dash

    Argh, why do these need to be lengthy videos.

    Can't MS just document things?

Add Your 2 Cents