-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion] .Net Core: Alternative approaches #1221
Comments
I have found one solution to optimize bundle:
|
I don't think there's ever been a firm, "you have to do it this way" for any of the @MarkPieszak feel free to chime in here. If you feel that this is the better way to go, we can certainly publish more than one package. |
Just one update - With 9.0(@next version) we also fixed all optimization issues with server bundles and is actually on by default for new projects. You should be able to use |
@vikerman thanks for sharing, yes I can confirm this works perfectly with .net core project. |
It is still beneficial to use the an engine for additional functionality such as inlining of critical css. That said, in future we might deprecate the aspnetcore-engine in favor of the common-engine. Although at the moment it is not clear how .NET 5 is going to support SSR due to the removal of the SpaServices and NodeServices. See: dotnet/aspnetcore#12890. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
What modules are related to this issue?
. Do we really need @nguniversal/aspnetcore-engine for SSR with .Net Core if we can do SSR without it?
Here's my main.server file:
And below is the .Net Code in Startup.cs file:
This setup works fine, and can return HTTP status code e.g. 404 in case of page not found errors.
Using this approach we can setup page title and meta tags directly from Angular app i.e. using Meta, Title services from Angular.
import { Meta, Title } from '@angular/platform-browser';
The only issue with this approach is that we can not enable optimization (
"optimization": false,
) for server builds as a result the server bundle is not treeshaken due to this issue:angular/angular-cli#8616
I would like to know your feedback on this approach.
@MarkPieszak @paolomainardi @PatrickJS @Toxicable @vikerman
The text was updated successfully, but these errors were encountered: