Angular Library Route Module does not work when imported in application

前端 未结 2 601
难免孤独
难免孤独 2021-01-18 16:33

I need a help about an issue that I cannot solve. I\'m studying angular 7 library in order to add modularization to my application but module routes defined in library seems

相关标签:
2条回答
  • 2021-01-18 16:41

    Finally I founded a solution. I describe it below in order to help community. In this scenario we need to add "preserveSymlinks": true option in build sectionto main application angular.json, the one that imported external library by npm link command.

    "architect": {
      "build": {
        "builder": "@angular-devkit/build-angular:browser",
        "options": {
          "preserveSymlinks": true,
    

    Credits filipesilva on angular-cli issues

    Hope this can help someone else in future.

    Thanks

    0 讨论(0)
  • 2021-01-18 16:47

    I have an angular 11 project and I fixed this error. I enabled enableIvy in angularCompilerOptions in the tsconfig.lib.prod.json and I have built with --prod.

      "angularCompilerOptions": {
        "enableIvy": true
      }
    
    0 讨论(0)
提交回复
热议问题