1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How can I eagerly import a subset from a lazy loaded library in an NX workspace?

Discussão em 'Angular' iniciado por Felix Lemke, Outubro 3, 2024 às 09:42.

  1. Felix Lemke

    Felix Lemke Guest

    I am having the following situation for my application. It is an NX workspace with an Angular application and several Angular libraries. E.g.

    /apps
    /myapp
    /myapp-e2e
    /libs
    /movies
    /books


    The movies and books libraries both contain an NgRX (forFeature) store and the corresponding NgModules are loaded lazily via routing in the myapp router configuration. Now I have the situation that I would like to import only the NgRX actions from either of these libraries but the Module itself should remain lazily loaded. The nrwl linting throws that it is not allowed to import from lazy loaded modules


    nx-enforce-module-boundaries: imports of lazy-loaded libraries are forbidden

    But having an extra shared library just for the store actions seems to be over the roof and I don't want to pollute the libs folder too much. Is it possible to import only a subset of a library and keep the corresponding Angular library module be imported lazily?

    Continue reading...

Compartilhe esta Página