JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

Angular CLI SPA Template

Open DustinEwers opened this issue 9 years ago • 1 comments

@SteveSandersonMS

I was looking at the Core 2.0 SPA templates and I noticed that the Angular template was still using Webpack. For Angular projects, it's generally recommended that you use the Angular CLI. All of the Angular docs prefer this approach, so ideally we'd use it in .NET Core + Angular projects as well.

I did a post on how to do this integration (for .NET Core 1.0) from scratch: https://dustinewers.com/angular-cli-with-net-core/

Would it be okay to either build a separate template with Angular CLI or update the current Angular Template to use it? I'd be happy to take a shot at this task and send over a pull request.

DustinEwers avatar Sep 11 '17 12:09 DustinEwers

@DustinEwers We can bear this in mind for possible changes in the future, but in the short term we're not planning to take out the explicit Webpack config. Even if you use Angular CLI you are still using Webpack - it's just hidden from you. Having an explicit Webpack config allows for a much wider range of customisations, plus provides a clean place where we can integrate with ASP.NET Core's Webpack dev middleware.

If you find you're able to produce an Angular CLI-based project that has all the same functionality as the template here (including integration with ASP.NET Core Webpack dev middleware, server-side prerendering, AoT on publish (but not in dev), VS-based debugging, equally fast or faster builds in dev mode), then please let us know because at that point it would certainly be worth considering restructuring towards.

I'll close for now as it's not something we're expecting to do in the short term. Hope that's OK!

SteveSandersonMS avatar Sep 11 '17 14:09 SteveSandersonMS