Pular para o conteúdo
angular challenges logo Angular Challenges

🟢 Static vs Dynamic Import

Desafio #42

Este conteúdo não está disponível em sua língua ainda.

Criado por Thomas Laforge

Information

If you are using Nx, you might have encountered this error:

Static imports of lazy-loaded libraries are forbidden.
Library "users" is lazy-loaded in these files:
- apps/nx/static-dynamic-import/src/app/app.config.ts eslint@nx/enforce-module-boundaries

This error is part of the ESLint rule embedded by Nx to prevent people from mixing lazy-loading and eagerly-loading code from the same library. Although this error will not break at runtime or build time, it can lead to consequences for bundle size. The lazy-loaded code will end up in the main bundle, nullifying all the benefits of lazy-loading a library.

Statement

The goal of this challenge is to improve the code architecture to eliminate this ESLint error.

You will learn how to create a library and how to rearrange code.

Contribuidores

Obrigado a todos os contribuidores que ajudaram a melhorar esta documentação!

  • tomalaforge