Ng serve with linked npm package with watch enabled compiling too slow after edits in package

Discussão em 'Angular' iniciado por glob0_o, Março 4, 2025.

  1. glob0_o

    glob0_o Guest

    Preconditions:

    Angular 14 npm package that is linked locally with npm link and is building with tsc && (concurrently "tsc -w" "tsc-alias -w")

    I need to import package from dist folder, not from src

    Problem:

    When I serve my app using ng serve and make changes in library, library itself is built fast but app takes a lot of time to recompile (3 times longer then usually).

    What i tried:

    • I tried configuring webpack to exclude all node_modules except my package. Then i noticed that after changing any file in node_modules, app also takes a lot of time recompiling.
    • I tried flag incremental
    • List item
    • I tried HMR
    • I tried disabling and enabling compiler option preserveSymLinks for tsconfig
    • I tried to set path to package locally without symlink in tsconfig.
    • I tried creating angular lib for this package.

    Continue reading...

Compartilhe esta Página