Debugging TypeScript files outside wwwroot

后端 未结 5 826
走了就别回头了
走了就别回头了 2020-12-31 09:40

How should I debug TypeScript files in ASP.NET 5? Suppose solution layout as on the following picture. Notice .ts Scripts are outside wwwroot folder and compiled .js file is

5条回答
  •  Happy的楠姐
    2020-12-31 10:10

    An update with ASP.Net Core release for a good stef's answer (that won't compile now):

    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseFileServer(new FileServerOptions()
            {
                FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "Scripts")),
                RequestPath = new PathString("/app"),
            });
        }
    }
    

提交回复
热议问题