Questions on .NET Core 3.1 & Angular SSR spa.UseSpaPrerendering alternative

前端 未结 2 1784
野趣味
野趣味 2021-02-09 16:40

I created this post to get some insights from the community. A little while ago with the release of .NET Core 3.0 the usage of the well-known and widely used spa.UseSpaPre

2条回答
  •  孤城傲影
    2021-02-09 17:22

    I'm struggling with netcore 3.1 and angular too when it comes to deploy the project on azure or anything.. did you find anything? Could you provide your startup file? when I use dotnet publish, package.json is not copied to publish/ClientApp directory so the command used by spa.UseAngularCliServer() fails or it just doesn't find /index.html.

    for now, I run my project locally like this:

    app.UseSpa(spa =>
      {
        spa.Options.SourcePath = "ClientApp";
        if (env.IsDevelopment())
        {
          spa.UseAngularCliServer(npmScript: "dev:ssr");
        }
      });
    

提交回复
热议问题