Skip to content

Commit acab97f

Browse files
committed
#16 VueCliMiddleware middleware updated to 3.0.0
1 parent 30e4baf commit acab97f

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

AspNetCoreVueStarter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<ItemGroup>
2222
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.0.0" />
23-
<PackageReference Include="VueCliMiddleware" Version="3.0.0-preview7-1" />
23+
<PackageReference Include="VueCliMiddleware" Version="3.0.0" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

Startup.cs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5555
name: "default",
5656
pattern: "{controller}/{action=Index}/{id?}");
5757

58-
endpoints.MapToVueCliProxy("{*path}",
58+
endpoints.MapToVueCliProxy(
59+
"{*path}",
5960
new SpaOptions { SourcePath = "ClientApp" },
60-
"serve"
61-
//, regex: "Compiled successfully"
62-
);
61+
npmScript: (System.Diagnostics.Debugger.IsAttached) ? "serve" : null,
62+
regex: "Compiled successfully");
6363
});
64-
65-
//app.UseSpa(spa =>
66-
//{
67-
// spa.Options.SourcePath = "ClientApp";
68-
69-
// if (env.IsDevelopment())
70-
// {
71-
// // run npm process with client app
72-
// spa.UseVueCli(npmScript: "serve", port: 8080);
73-
// // if you just prefer to proxy requests from client app, use proxy to SPA dev server instead:
74-
// // app should be already running before starting a .NET client
75-
// // spa.UseProxyToSpaDevelopmentServer("http://localhost:8080"); // your Vue app port
76-
// }
77-
//});
7864
}
7965
}
8066
}

0 commit comments

Comments
 (0)