This is a stand-alone module to add VueCli support to AspNet Core 2.2.0.
using VueCliMiddleware;
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public virtual void ConfigureServices(IServiceCollection services)
{
services.AddMvc(); // etc
}
public virtual void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
// your config opts...
// add static files from SPA (/dist)
app.UseSpaStaticFiles();
app.UseMvc(routes => /* configure*/ );
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
#if DEBUG
if (env.IsDevelopment())
{
spa.UseVueCli(npmScript: "serve", port: 8080); // optional port
}
#endif
});
}
}
Due to the discussion here, it was decided to not be included in the Microsoft owned package.