Skip to content

feat(@schematics/angular): enable lazy loading on the server for new projects #17352

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

Merged
merged 2 commits into from
Apr 2, 2020
Merged

feat(@schematics/angular): enable lazy loading on the server for new projects #17352

merged 2 commits into from
Apr 2, 2020

Conversation

alan-agius4
Copy link
Collaborator

With this change, lazy-loading on the server becomes enabled out of the box for new projects. This is because webpack will only split ES6 imports into separate chunks. However when using commonjs all lazy loaded paths will be concatenated into the main.js file.

…Chunks`

Previusly this option didn't have an effect on platform server because when targetting commonjs all chunks will be concatenated into main.js.

We now changed the module to esnext, which enables us to have lazy loading on the server.
…projects

With this change, lazy-loading on the server becomes enabled out of the box for new projects. This is because webpack will only split ES6 imports into separate chunks. However when using commonjs all lazy loaded paths will be concatenated into the main.js file.
@alan-agius4 alan-agius4 requested a review from filipesilva March 31, 2020 14:59
@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Mar 31, 2020
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Mar 31, 2020
Copy link
Contributor

@MarkPieszak MarkPieszak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

alan-agius4 added a commit to angular/universal that referenced this pull request Apr 1, 2020
@kyliau kyliau merged commit a2b158b into angular:master Apr 2, 2020
@alan-agius4 alan-agius4 deleted the universal-lazy-loading branch April 2, 2020 17:54
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants