0

In my company, there's a ASP.NET WebApp that uses ASP.NET MVC Bundles and by that I mean this.

public static void RegisterBundles(BundleCollection bundles)
{
    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                 "~/Scripts/jquery-{version}.js"));

    // Code removed for clarity.
    BundleTable.EnableOptimizations = true;
}

When I'm working on the app, and I change a piece of typescript, I need to stop the application and start it again so MVC will compile TS and turn it into JS

My question is, is there anyway I can turn TS into JS and refresh the page I'm looking at so my changes will be taken and I can debug the new changes in my browser without having to restart the whole application

PS I turn off "EnableOptimizations" option so instead of getting minified everything is just in 1 file

1 Answer 1

1

There is a great article about using Live Reload and Browser Sync to be able to recompile on the fly. Keep in mind that since you're using TypeScript and it has to be compiled into physical JS files, you'll need a solution like this until Microsoft puts out its own feature to be able to live reload compiled code.

This article assumes you are using ASP.NET Core, by the way, not ASP.NET Framework.

https://weblog.west-wind.com/posts/2019/May/18/Live-Reloading-Server-Side-ASPNET-Core-Apps

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.