美文网首页
前后端调试(.net core)

前后端调试(.net core)

作者: wuzinong | 来源:发表于2022-06-17 11:25 被阅读0次

    1. Parcel

        package.json:

        "scripts": {

            "clean": "rimraf dist && rimraf .parcel-cache && rimraf ../Veracity.Account.Web/wwwroot",

            "start": "parcel --dist-dir ../Test.Web/wwwroot -p 5001 --hmr-port 5002",

        },

    Startup.cs/Program.cs

        nuget: Microsoft.AspNetCore.SpaServices.Extensions

         if (app.Environment.IsDevelopment())

      {

            app.UseSpa(spa =>

        {

            //spa.Options.SourcePath = "wwwroot";

            // spa.UseReactDevelopmentServer(npmScript: "start");

            spa.UseProxyToSpaDevelopmentServer("http://localhost:3001");

    });

    }

    2. Vite

        vite.config.ts:

         server: {

          // watch: {

          //  ignored: ['!**/node_modules/**']

          // },

          hmr: {

            clientPort: 44355

          }

        },

    Startup.cs/Program.cs

        nuget:Microsoft.AspNetCore.SpaServices.Extensions

    app.UseSpa(spa =>

    {

    //spa.Options.SourcePath = "../veracity.ordermonitor.frontend";

    if (env.IsDevelopment())

    {

    // spa.UseReactDevelopmentServer(npmScript: "start");

    spa.UseProxyToSpaDevelopmentServer("http://localhost:3000");

    }

    });

    相关文章

      网友评论

          本文标题:前后端调试(.net core)

          本文链接:https://www.haomeiwen.com/subject/slocvrtx.html