1

Me and my team are developing a fairly small application (basically just a login page that will redirect you somewhere else). We currently had the idea of having one Core module and one module with the rest of the content of the page but it seems like overkill given the fact that we will always load that module before anything is painted on the screen anyways. Would there still be a valid reason to include lazy loading or would be better off just importing the module into the AppModule directly?

I'm aware of the benefits of lazy loading but we are certain that this application will not grow much if at all.

2 Answers 2

1

Lazy loading helps you to reduce the size of initial bundle files and only loads more chunks if needed. In your scenario if you do not have anything to load later, you practically do not need lazy loading as it will not be useful.

Sign up to request clarification or add additional context in comments.

Comments

1

Creating a modular architecture is important. Lazy loading will then only become a matter of some routing configurations. You can tweak whether you want to do lazy loading or not based on how quickly your app loads on the first go.

Another thought is if you are making different API calls to get some data in different modules then you might consider loading lazily. But if everything loads at once, then as I said above you can compare performance with and without lazy loading.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.