Visual Studio + ASP.NET Core + TypeScript - who compiles *.ts?












10















I am confused about what gets to compile TypeScript files for me and when:




  1. Visual Studio on save.

  2. Mads Kristensen's extensions.

  3. Gulp.js.

  4. Node.js.

  5. Something else.


Where should TypeScript files be placed:




  1. ..app*.ts

  2. ..wwwrootapp*.ts


How to make TypeScript compilation super-fast and get the auto-update or auto-deploy with immediate effect in browser?



What happens on build server like TeamCity?



PS: same applies to LESS?










share|improve this question





























    10















    I am confused about what gets to compile TypeScript files for me and when:




    1. Visual Studio on save.

    2. Mads Kristensen's extensions.

    3. Gulp.js.

    4. Node.js.

    5. Something else.


    Where should TypeScript files be placed:




    1. ..app*.ts

    2. ..wwwrootapp*.ts


    How to make TypeScript compilation super-fast and get the auto-update or auto-deploy with immediate effect in browser?



    What happens on build server like TeamCity?



    PS: same applies to LESS?










    share|improve this question



























      10












      10








      10


      5






      I am confused about what gets to compile TypeScript files for me and when:




      1. Visual Studio on save.

      2. Mads Kristensen's extensions.

      3. Gulp.js.

      4. Node.js.

      5. Something else.


      Where should TypeScript files be placed:




      1. ..app*.ts

      2. ..wwwrootapp*.ts


      How to make TypeScript compilation super-fast and get the auto-update or auto-deploy with immediate effect in browser?



      What happens on build server like TeamCity?



      PS: same applies to LESS?










      share|improve this question
















      I am confused about what gets to compile TypeScript files for me and when:




      1. Visual Studio on save.

      2. Mads Kristensen's extensions.

      3. Gulp.js.

      4. Node.js.

      5. Something else.


      Where should TypeScript files be placed:




      1. ..app*.ts

      2. ..wwwrootapp*.ts


      How to make TypeScript compilation super-fast and get the auto-update or auto-deploy with immediate effect in browser?



      What happens on build server like TeamCity?



      PS: same applies to LESS?







      visual-studio typescript gulp asp.net-core web-essentials






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 21 '16 at 11:19







      Den

















      asked Sep 20 '16 at 11:28









      DenDen

      1,01721936




      1,01721936
























          4 Answers
          4






          active

          oldest

          votes


















          4














          In my pet project I use gulp for building .less an .ts files. It work like this:



          gulp.task('processTypeScript', function () {
          gulp.src('Content/TypeScript/**/*.ts')
          .pipe(sourcemaps.init())
          .pipe(ts(tsOptions)).js
          .pipe(sourcemaps.write())
          .pipe(gulp.dest('./wwwroot/content/script'));
          });
          gulp.task('build', ['copyLibs', 'processTypeScript', 'processLess']);


          The first task builds typescript files with adding sourcemaps and copies result to wwwroot folder, The second one is completely building of all client-side code — I don't describe all these task, they are the same.



          For comfortable developing I use watch mechanism, so it's pretty easy:



          gulp.task('watch', ['processTypeScript', 'processLess'], function () {
          gulp.watch('Content/TypeScript/**/*.ts', ['processTypeScript']);
          gulp.watch('Content/Less/**/*.less', ['processLess']);
          });


          And now typescript file will be recompiled on any changes in it.



          For adding files to html I use this approach



          <environment names="Development">
          <script asp-src-include="~/content/script/**/*.js" asp-append-version="true"></script>
          <link rel="stylesheet" asp-href-include="~/content/style/**/*.css" asp-append-version="true" />
          </environment>


          Note to asp-append-version — that prevents caching in browser.



          Finally you can build minimized uglified script and style files via gulp for prodution configuration and include thay on page in <environment names="Production"> tag.



          So, it's very comfortable for me. I have added build and watch tasks on project open and don't take care about compiling scripts and styles.






          share|improve this answer

































            2














            Commonly, visual studio can compile .ts to .js in project when save the ts file.



            You can place TypeScript at both places.



            If you choose ..app*.ts, you need to use gulp to help you put js in wwwroot.

            And you may need gule to watch ts file in development so it can be auto-update.



            If you choose ..wwwrootapp*.ts, js can auto-update in browser. But user can also get your ts file if they want.



            TeamCity may not compile ts unless you explicit to compile it using tsc.






            share|improve this answer































              2














              At the moment my understanding is that the VisualStudio templates do not have post build instructions in the xproj to do the compilation of typescript. Although this is something that will probably change in the tooling when it gets out of preview.



              In my current setup I rely on npm typescript package and a gulp task both to create the .js output and the sourcemaps for my typescript projects.



              I got a folder containing all my typescript sources under my wwwroot/app



              - wwwroot
              - app
              - typings
              - globals
              index.d.ts
              app.ts
              tsconfig.json
              tslint.json


              my gulp task for building javascript and sourcemaps:



              gulp.task('build:ts', false, function () {
              var tsProject = $.typescript.createProject(app + 'tsconfig.json', { sortOutput: true });
              var stream = tsProject.src();
              return stream.pipe($.sourcemaps.init())
              .pipe($.typescript(tsProject))
              .pipe($.sourcemaps.write('.', { includeContent: false, sourceRoot: '' }))
              .pipe(gulp.dest(app));
              });


              last but not least I use typings to fetch typescript definitions.



              If you got a complete frontend story for building scripts (less included). Then a build server can restore your npm devdependencies and run your gulp tasks to build your front end code just fine. Same applies for Visualstuio online build tasks.






              share|improve this answer
























              • I just noticed that my project.json has a tsc invocation as well.

                – Den
                Sep 20 '16 at 17:04











              • The downside of your approach is deploying *.ts files and potentially serving them to browser. Not a problem, but not tidy. You should copy compilation results into wwwroot from some other folder. typescriptlang.org/docs/handbook/asp-net-core.html

                – Den
                Sep 20 '16 at 17:06











              • github.com/Microsoft/TypeScript-Handbook/issues/387

                – Den
                Sep 20 '16 at 17:07











              • @Den If this is an issue you can always chose to exclude the *.ts files from publishing &TeamCity will respect that. This can be done on the project.json file under the publishOptions setting. "exclude": ["*.ts"]

                – cleftheris
                Sep 21 '16 at 10:48



















              -2














              This confused me a bit as well.



              Using .net core I have not had to do anything seperate to compile the type script whether I build from the IDE or from commandline using dotnet build.



              The tsconfig.json file seems to dictate the typescript build.



              JS and MAP files get created in the same folder as the TS file which keeps it all quite clean.



              I have uploaded all this working. See: https://github.com/MikeyFriedChicken/DotNetCoreTypeScript



              Many Thanks



              Michael






              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39592886%2fvisual-studio-asp-net-core-typescript-who-compiles-ts%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                4














                In my pet project I use gulp for building .less an .ts files. It work like this:



                gulp.task('processTypeScript', function () {
                gulp.src('Content/TypeScript/**/*.ts')
                .pipe(sourcemaps.init())
                .pipe(ts(tsOptions)).js
                .pipe(sourcemaps.write())
                .pipe(gulp.dest('./wwwroot/content/script'));
                });
                gulp.task('build', ['copyLibs', 'processTypeScript', 'processLess']);


                The first task builds typescript files with adding sourcemaps and copies result to wwwroot folder, The second one is completely building of all client-side code — I don't describe all these task, they are the same.



                For comfortable developing I use watch mechanism, so it's pretty easy:



                gulp.task('watch', ['processTypeScript', 'processLess'], function () {
                gulp.watch('Content/TypeScript/**/*.ts', ['processTypeScript']);
                gulp.watch('Content/Less/**/*.less', ['processLess']);
                });


                And now typescript file will be recompiled on any changes in it.



                For adding files to html I use this approach



                <environment names="Development">
                <script asp-src-include="~/content/script/**/*.js" asp-append-version="true"></script>
                <link rel="stylesheet" asp-href-include="~/content/style/**/*.css" asp-append-version="true" />
                </environment>


                Note to asp-append-version — that prevents caching in browser.



                Finally you can build minimized uglified script and style files via gulp for prodution configuration and include thay on page in <environment names="Production"> tag.



                So, it's very comfortable for me. I have added build and watch tasks on project open and don't take care about compiling scripts and styles.






                share|improve this answer






























                  4














                  In my pet project I use gulp for building .less an .ts files. It work like this:



                  gulp.task('processTypeScript', function () {
                  gulp.src('Content/TypeScript/**/*.ts')
                  .pipe(sourcemaps.init())
                  .pipe(ts(tsOptions)).js
                  .pipe(sourcemaps.write())
                  .pipe(gulp.dest('./wwwroot/content/script'));
                  });
                  gulp.task('build', ['copyLibs', 'processTypeScript', 'processLess']);


                  The first task builds typescript files with adding sourcemaps and copies result to wwwroot folder, The second one is completely building of all client-side code — I don't describe all these task, they are the same.



                  For comfortable developing I use watch mechanism, so it's pretty easy:



                  gulp.task('watch', ['processTypeScript', 'processLess'], function () {
                  gulp.watch('Content/TypeScript/**/*.ts', ['processTypeScript']);
                  gulp.watch('Content/Less/**/*.less', ['processLess']);
                  });


                  And now typescript file will be recompiled on any changes in it.



                  For adding files to html I use this approach



                  <environment names="Development">
                  <script asp-src-include="~/content/script/**/*.js" asp-append-version="true"></script>
                  <link rel="stylesheet" asp-href-include="~/content/style/**/*.css" asp-append-version="true" />
                  </environment>


                  Note to asp-append-version — that prevents caching in browser.



                  Finally you can build minimized uglified script and style files via gulp for prodution configuration and include thay on page in <environment names="Production"> tag.



                  So, it's very comfortable for me. I have added build and watch tasks on project open and don't take care about compiling scripts and styles.






                  share|improve this answer




























                    4












                    4








                    4







                    In my pet project I use gulp for building .less an .ts files. It work like this:



                    gulp.task('processTypeScript', function () {
                    gulp.src('Content/TypeScript/**/*.ts')
                    .pipe(sourcemaps.init())
                    .pipe(ts(tsOptions)).js
                    .pipe(sourcemaps.write())
                    .pipe(gulp.dest('./wwwroot/content/script'));
                    });
                    gulp.task('build', ['copyLibs', 'processTypeScript', 'processLess']);


                    The first task builds typescript files with adding sourcemaps and copies result to wwwroot folder, The second one is completely building of all client-side code — I don't describe all these task, they are the same.



                    For comfortable developing I use watch mechanism, so it's pretty easy:



                    gulp.task('watch', ['processTypeScript', 'processLess'], function () {
                    gulp.watch('Content/TypeScript/**/*.ts', ['processTypeScript']);
                    gulp.watch('Content/Less/**/*.less', ['processLess']);
                    });


                    And now typescript file will be recompiled on any changes in it.



                    For adding files to html I use this approach



                    <environment names="Development">
                    <script asp-src-include="~/content/script/**/*.js" asp-append-version="true"></script>
                    <link rel="stylesheet" asp-href-include="~/content/style/**/*.css" asp-append-version="true" />
                    </environment>


                    Note to asp-append-version — that prevents caching in browser.



                    Finally you can build minimized uglified script and style files via gulp for prodution configuration and include thay on page in <environment names="Production"> tag.



                    So, it's very comfortable for me. I have added build and watch tasks on project open and don't take care about compiling scripts and styles.






                    share|improve this answer















                    In my pet project I use gulp for building .less an .ts files. It work like this:



                    gulp.task('processTypeScript', function () {
                    gulp.src('Content/TypeScript/**/*.ts')
                    .pipe(sourcemaps.init())
                    .pipe(ts(tsOptions)).js
                    .pipe(sourcemaps.write())
                    .pipe(gulp.dest('./wwwroot/content/script'));
                    });
                    gulp.task('build', ['copyLibs', 'processTypeScript', 'processLess']);


                    The first task builds typescript files with adding sourcemaps and copies result to wwwroot folder, The second one is completely building of all client-side code — I don't describe all these task, they are the same.



                    For comfortable developing I use watch mechanism, so it's pretty easy:



                    gulp.task('watch', ['processTypeScript', 'processLess'], function () {
                    gulp.watch('Content/TypeScript/**/*.ts', ['processTypeScript']);
                    gulp.watch('Content/Less/**/*.less', ['processLess']);
                    });


                    And now typescript file will be recompiled on any changes in it.



                    For adding files to html I use this approach



                    <environment names="Development">
                    <script asp-src-include="~/content/script/**/*.js" asp-append-version="true"></script>
                    <link rel="stylesheet" asp-href-include="~/content/style/**/*.css" asp-append-version="true" />
                    </environment>


                    Note to asp-append-version — that prevents caching in browser.



                    Finally you can build minimized uglified script and style files via gulp for prodution configuration and include thay on page in <environment names="Production"> tag.



                    So, it's very comfortable for me. I have added build and watch tasks on project open and don't take care about compiling scripts and styles.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Sep 21 '16 at 11:43

























                    answered Sep 21 '16 at 7:42









                    user3272018user3272018

                    65341330




                    65341330

























                        2














                        Commonly, visual studio can compile .ts to .js in project when save the ts file.



                        You can place TypeScript at both places.



                        If you choose ..app*.ts, you need to use gulp to help you put js in wwwroot.

                        And you may need gule to watch ts file in development so it can be auto-update.



                        If you choose ..wwwrootapp*.ts, js can auto-update in browser. But user can also get your ts file if they want.



                        TeamCity may not compile ts unless you explicit to compile it using tsc.






                        share|improve this answer




























                          2














                          Commonly, visual studio can compile .ts to .js in project when save the ts file.



                          You can place TypeScript at both places.



                          If you choose ..app*.ts, you need to use gulp to help you put js in wwwroot.

                          And you may need gule to watch ts file in development so it can be auto-update.



                          If you choose ..wwwrootapp*.ts, js can auto-update in browser. But user can also get your ts file if they want.



                          TeamCity may not compile ts unless you explicit to compile it using tsc.






                          share|improve this answer


























                            2












                            2








                            2







                            Commonly, visual studio can compile .ts to .js in project when save the ts file.



                            You can place TypeScript at both places.



                            If you choose ..app*.ts, you need to use gulp to help you put js in wwwroot.

                            And you may need gule to watch ts file in development so it can be auto-update.



                            If you choose ..wwwrootapp*.ts, js can auto-update in browser. But user can also get your ts file if they want.



                            TeamCity may not compile ts unless you explicit to compile it using tsc.






                            share|improve this answer













                            Commonly, visual studio can compile .ts to .js in project when save the ts file.



                            You can place TypeScript at both places.



                            If you choose ..app*.ts, you need to use gulp to help you put js in wwwroot.

                            And you may need gule to watch ts file in development so it can be auto-update.



                            If you choose ..wwwrootapp*.ts, js can auto-update in browser. But user can also get your ts file if they want.



                            TeamCity may not compile ts unless you explicit to compile it using tsc.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Sep 20 '16 at 16:19









                            qinqin

                            575315




                            575315























                                2














                                At the moment my understanding is that the VisualStudio templates do not have post build instructions in the xproj to do the compilation of typescript. Although this is something that will probably change in the tooling when it gets out of preview.



                                In my current setup I rely on npm typescript package and a gulp task both to create the .js output and the sourcemaps for my typescript projects.



                                I got a folder containing all my typescript sources under my wwwroot/app



                                - wwwroot
                                - app
                                - typings
                                - globals
                                index.d.ts
                                app.ts
                                tsconfig.json
                                tslint.json


                                my gulp task for building javascript and sourcemaps:



                                gulp.task('build:ts', false, function () {
                                var tsProject = $.typescript.createProject(app + 'tsconfig.json', { sortOutput: true });
                                var stream = tsProject.src();
                                return stream.pipe($.sourcemaps.init())
                                .pipe($.typescript(tsProject))
                                .pipe($.sourcemaps.write('.', { includeContent: false, sourceRoot: '' }))
                                .pipe(gulp.dest(app));
                                });


                                last but not least I use typings to fetch typescript definitions.



                                If you got a complete frontend story for building scripts (less included). Then a build server can restore your npm devdependencies and run your gulp tasks to build your front end code just fine. Same applies for Visualstuio online build tasks.






                                share|improve this answer
























                                • I just noticed that my project.json has a tsc invocation as well.

                                  – Den
                                  Sep 20 '16 at 17:04











                                • The downside of your approach is deploying *.ts files and potentially serving them to browser. Not a problem, but not tidy. You should copy compilation results into wwwroot from some other folder. typescriptlang.org/docs/handbook/asp-net-core.html

                                  – Den
                                  Sep 20 '16 at 17:06











                                • github.com/Microsoft/TypeScript-Handbook/issues/387

                                  – Den
                                  Sep 20 '16 at 17:07











                                • @Den If this is an issue you can always chose to exclude the *.ts files from publishing &TeamCity will respect that. This can be done on the project.json file under the publishOptions setting. "exclude": ["*.ts"]

                                  – cleftheris
                                  Sep 21 '16 at 10:48
















                                2














                                At the moment my understanding is that the VisualStudio templates do not have post build instructions in the xproj to do the compilation of typescript. Although this is something that will probably change in the tooling when it gets out of preview.



                                In my current setup I rely on npm typescript package and a gulp task both to create the .js output and the sourcemaps for my typescript projects.



                                I got a folder containing all my typescript sources under my wwwroot/app



                                - wwwroot
                                - app
                                - typings
                                - globals
                                index.d.ts
                                app.ts
                                tsconfig.json
                                tslint.json


                                my gulp task for building javascript and sourcemaps:



                                gulp.task('build:ts', false, function () {
                                var tsProject = $.typescript.createProject(app + 'tsconfig.json', { sortOutput: true });
                                var stream = tsProject.src();
                                return stream.pipe($.sourcemaps.init())
                                .pipe($.typescript(tsProject))
                                .pipe($.sourcemaps.write('.', { includeContent: false, sourceRoot: '' }))
                                .pipe(gulp.dest(app));
                                });


                                last but not least I use typings to fetch typescript definitions.



                                If you got a complete frontend story for building scripts (less included). Then a build server can restore your npm devdependencies and run your gulp tasks to build your front end code just fine. Same applies for Visualstuio online build tasks.






                                share|improve this answer
























                                • I just noticed that my project.json has a tsc invocation as well.

                                  – Den
                                  Sep 20 '16 at 17:04











                                • The downside of your approach is deploying *.ts files and potentially serving them to browser. Not a problem, but not tidy. You should copy compilation results into wwwroot from some other folder. typescriptlang.org/docs/handbook/asp-net-core.html

                                  – Den
                                  Sep 20 '16 at 17:06











                                • github.com/Microsoft/TypeScript-Handbook/issues/387

                                  – Den
                                  Sep 20 '16 at 17:07











                                • @Den If this is an issue you can always chose to exclude the *.ts files from publishing &TeamCity will respect that. This can be done on the project.json file under the publishOptions setting. "exclude": ["*.ts"]

                                  – cleftheris
                                  Sep 21 '16 at 10:48














                                2












                                2








                                2







                                At the moment my understanding is that the VisualStudio templates do not have post build instructions in the xproj to do the compilation of typescript. Although this is something that will probably change in the tooling when it gets out of preview.



                                In my current setup I rely on npm typescript package and a gulp task both to create the .js output and the sourcemaps for my typescript projects.



                                I got a folder containing all my typescript sources under my wwwroot/app



                                - wwwroot
                                - app
                                - typings
                                - globals
                                index.d.ts
                                app.ts
                                tsconfig.json
                                tslint.json


                                my gulp task for building javascript and sourcemaps:



                                gulp.task('build:ts', false, function () {
                                var tsProject = $.typescript.createProject(app + 'tsconfig.json', { sortOutput: true });
                                var stream = tsProject.src();
                                return stream.pipe($.sourcemaps.init())
                                .pipe($.typescript(tsProject))
                                .pipe($.sourcemaps.write('.', { includeContent: false, sourceRoot: '' }))
                                .pipe(gulp.dest(app));
                                });


                                last but not least I use typings to fetch typescript definitions.



                                If you got a complete frontend story for building scripts (less included). Then a build server can restore your npm devdependencies and run your gulp tasks to build your front end code just fine. Same applies for Visualstuio online build tasks.






                                share|improve this answer













                                At the moment my understanding is that the VisualStudio templates do not have post build instructions in the xproj to do the compilation of typescript. Although this is something that will probably change in the tooling when it gets out of preview.



                                In my current setup I rely on npm typescript package and a gulp task both to create the .js output and the sourcemaps for my typescript projects.



                                I got a folder containing all my typescript sources under my wwwroot/app



                                - wwwroot
                                - app
                                - typings
                                - globals
                                index.d.ts
                                app.ts
                                tsconfig.json
                                tslint.json


                                my gulp task for building javascript and sourcemaps:



                                gulp.task('build:ts', false, function () {
                                var tsProject = $.typescript.createProject(app + 'tsconfig.json', { sortOutput: true });
                                var stream = tsProject.src();
                                return stream.pipe($.sourcemaps.init())
                                .pipe($.typescript(tsProject))
                                .pipe($.sourcemaps.write('.', { includeContent: false, sourceRoot: '' }))
                                .pipe(gulp.dest(app));
                                });


                                last but not least I use typings to fetch typescript definitions.



                                If you got a complete frontend story for building scripts (less included). Then a build server can restore your npm devdependencies and run your gulp tasks to build your front end code just fine. Same applies for Visualstuio online build tasks.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Sep 20 '16 at 16:47









                                cleftheriscleftheris

                                3,1162644




                                3,1162644













                                • I just noticed that my project.json has a tsc invocation as well.

                                  – Den
                                  Sep 20 '16 at 17:04











                                • The downside of your approach is deploying *.ts files and potentially serving them to browser. Not a problem, but not tidy. You should copy compilation results into wwwroot from some other folder. typescriptlang.org/docs/handbook/asp-net-core.html

                                  – Den
                                  Sep 20 '16 at 17:06











                                • github.com/Microsoft/TypeScript-Handbook/issues/387

                                  – Den
                                  Sep 20 '16 at 17:07











                                • @Den If this is an issue you can always chose to exclude the *.ts files from publishing &TeamCity will respect that. This can be done on the project.json file under the publishOptions setting. "exclude": ["*.ts"]

                                  – cleftheris
                                  Sep 21 '16 at 10:48



















                                • I just noticed that my project.json has a tsc invocation as well.

                                  – Den
                                  Sep 20 '16 at 17:04











                                • The downside of your approach is deploying *.ts files and potentially serving them to browser. Not a problem, but not tidy. You should copy compilation results into wwwroot from some other folder. typescriptlang.org/docs/handbook/asp-net-core.html

                                  – Den
                                  Sep 20 '16 at 17:06











                                • github.com/Microsoft/TypeScript-Handbook/issues/387

                                  – Den
                                  Sep 20 '16 at 17:07











                                • @Den If this is an issue you can always chose to exclude the *.ts files from publishing &TeamCity will respect that. This can be done on the project.json file under the publishOptions setting. "exclude": ["*.ts"]

                                  – cleftheris
                                  Sep 21 '16 at 10:48

















                                I just noticed that my project.json has a tsc invocation as well.

                                – Den
                                Sep 20 '16 at 17:04





                                I just noticed that my project.json has a tsc invocation as well.

                                – Den
                                Sep 20 '16 at 17:04













                                The downside of your approach is deploying *.ts files and potentially serving them to browser. Not a problem, but not tidy. You should copy compilation results into wwwroot from some other folder. typescriptlang.org/docs/handbook/asp-net-core.html

                                – Den
                                Sep 20 '16 at 17:06





                                The downside of your approach is deploying *.ts files and potentially serving them to browser. Not a problem, but not tidy. You should copy compilation results into wwwroot from some other folder. typescriptlang.org/docs/handbook/asp-net-core.html

                                – Den
                                Sep 20 '16 at 17:06













                                github.com/Microsoft/TypeScript-Handbook/issues/387

                                – Den
                                Sep 20 '16 at 17:07





                                github.com/Microsoft/TypeScript-Handbook/issues/387

                                – Den
                                Sep 20 '16 at 17:07













                                @Den If this is an issue you can always chose to exclude the *.ts files from publishing &TeamCity will respect that. This can be done on the project.json file under the publishOptions setting. "exclude": ["*.ts"]

                                – cleftheris
                                Sep 21 '16 at 10:48





                                @Den If this is an issue you can always chose to exclude the *.ts files from publishing &TeamCity will respect that. This can be done on the project.json file under the publishOptions setting. "exclude": ["*.ts"]

                                – cleftheris
                                Sep 21 '16 at 10:48











                                -2














                                This confused me a bit as well.



                                Using .net core I have not had to do anything seperate to compile the type script whether I build from the IDE or from commandline using dotnet build.



                                The tsconfig.json file seems to dictate the typescript build.



                                JS and MAP files get created in the same folder as the TS file which keeps it all quite clean.



                                I have uploaded all this working. See: https://github.com/MikeyFriedChicken/DotNetCoreTypeScript



                                Many Thanks



                                Michael






                                share|improve this answer




























                                  -2














                                  This confused me a bit as well.



                                  Using .net core I have not had to do anything seperate to compile the type script whether I build from the IDE or from commandline using dotnet build.



                                  The tsconfig.json file seems to dictate the typescript build.



                                  JS and MAP files get created in the same folder as the TS file which keeps it all quite clean.



                                  I have uploaded all this working. See: https://github.com/MikeyFriedChicken/DotNetCoreTypeScript



                                  Many Thanks



                                  Michael






                                  share|improve this answer


























                                    -2












                                    -2








                                    -2







                                    This confused me a bit as well.



                                    Using .net core I have not had to do anything seperate to compile the type script whether I build from the IDE or from commandline using dotnet build.



                                    The tsconfig.json file seems to dictate the typescript build.



                                    JS and MAP files get created in the same folder as the TS file which keeps it all quite clean.



                                    I have uploaded all this working. See: https://github.com/MikeyFriedChicken/DotNetCoreTypeScript



                                    Many Thanks



                                    Michael






                                    share|improve this answer













                                    This confused me a bit as well.



                                    Using .net core I have not had to do anything seperate to compile the type script whether I build from the IDE or from commandline using dotnet build.



                                    The tsconfig.json file seems to dictate the typescript build.



                                    JS and MAP files get created in the same folder as the TS file which keeps it all quite clean.



                                    I have uploaded all this working. See: https://github.com/MikeyFriedChicken/DotNetCoreTypeScript



                                    Many Thanks



                                    Michael







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 22 '18 at 20:17









                                    Michael CeberMichael Ceber

                                    26215




                                    26215






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39592886%2fvisual-studio-asp-net-core-typescript-who-compiles-ts%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                                        Alcedinidae

                                        Origin of the phrase “under your belt”?