Title: Let 'lazyModules' option support modules from outside root in AOT mode · Issue #12859 · angular/angular-cli · GitHub
Open Graph Title: Let 'lazyModules' option support modules from outside root in AOT mode · Issue #12859 · angular/angular-cli
X Title: Let 'lazyModules' option support modules from outside root in AOT mode · Issue #12859 · angular/angular-cli
Description: Bug Report or Feature Request (mark with an x) - [ ] bug report -> please search issues before submitting - [X] feature request Command (mark with an x) - [ ] new - [X] build - [X] serve - [ ] test - [ ] e2e - [ ] generate - [ ] add - [ ...
Open Graph Description: Bug Report or Feature Request (mark with an x) - [ ] bug report -> please search issues before submitting - [X] feature request Command (mark with an x) - [ ] new - [X] build - [X] serve - [ ] test...
X Description: Bug Report or Feature Request (mark with an x) - [ ] bug report -> please search issues before submitting - [X] feature request Command (mark with an x) - [ ] new - [X] build - [X] serve - [ ] t...
Opengraph URL: https://github.com/angular/angular-cli/issues/12859
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Let 'lazyModules' option support modules from outside root in AOT mode","articleBody":"### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [ ] bug report -> please search issues before submitting\r\n- [X] feature request\r\n```\r\n\r\n### Command (mark with an `x`)\r\n```\r\n- [ ] new\r\n- [X] build\r\n- [X] serve\r\n- [ ] test\r\n- [ ] e2e\r\n- [ ] generate\r\n- [ ] add\r\n- [ ] update\r\n- [ ] lint\r\n- [ ] xi18n\r\n- [ ] run\r\n- [ ] config\r\n- [ ] help\r\n- [ ] version\r\n- [ ] doc\r\n```\r\n\r\n### Versions\r\n```\r\nAngular CLI: 7.0.3\r\nNode: 8.11.3\r\nOS: win32 x64\r\nAngular: 7.0.1\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... http, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\nPackage Version\r\n------------------------------------------------------------\r\n@angular-devkit/architect 0.10.3\r\n@angular-devkit/build-angular 0.10.3\r\n@angular-devkit/build-ng-packagr 0.10.3\r\n@angular-devkit/build-optimizer 0.10.3\r\n@angular-devkit/build-webpack 0.10.3\r\n@angular-devkit/core 7.0.3\r\n@angular-devkit/schematics 7.0.3\r\n@angular/cli 7.0.3\r\n@ngtools/json-schema 1.1.0\r\n@ngtools/webpack 7.0.3\r\n@schematics/angular 7.0.3\r\n@schematics/update 0.10.3\r\nng-packagr 4.4.0\r\nrxjs 6.3.3\r\ntypescript 3.1.4\r\nwebpack 4.19.1\r\n```\r\n\r\n### Repro steps\r\nThe addition of the 'lazyModules' option was something that people have been asking for for quite some time (to not \"abuse\" to router to create chunks). Unfortunately the lazyModules option still requires the module to be in the src folder, and therefore it is not possible to lazy load a module from a component library or an external dependency in node_modules. At the moment te only way to achieve this is to create another module that is somewhere under the src folder and imports the external module.\r\n\r\nThis works:\r\n```\r\nlazyModules: [\"src/app/proxies/sample-lib.proxy\"]\r\n```\r\n\r\n```ts\r\nimport { NgModule } from '@angular/core';\r\nimport { SampleLibModule, SampleLibComponent } from 'sample-lib';\r\n\r\n@NgModule({\r\n imports: [SampleLibModule],\r\n entryComponents: [SampleLibComponent]\r\n})\r\nexport class SampleLibProxyModule {\r\n\r\n}\r\n```\r\nand this doesn't\r\n```\r\nlazyModules: [\"projects/sample-lib/sample-lib.module\"]\r\n```\r\n\r\n### The log given by the failure\r\nIt curently fails with something like\r\n```\r\nERROR in ./src/$$_lazy_route_resource lazy namespace object\r\nModule not found: Error: Can't resolve '\u003cmypath>/projects/sample-lib/src/lib/sample-lib.module.ngfactory.js' in \u003cmypath>\\src\\$$_lazy_route_resource'\r\n``` \r\n\r\n### Desired functionality\r\nlazyModules also supports including modules from node_modules and projects folders.\r\n","author":{"url":"https://github.com/woppa684","@type":"Person","name":"woppa684"},"datePublished":"2018-11-03T11:36:08Z","url":"https://github.com/angular/angular-cli/issues/12859"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f444cc55-177d-a92b-0347-292518c32cac |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE7E:DA744:101CAA8:15AC435:6B0119A0 |
| html-safe-nonce | eb92f1446f68c21f6c400274493fa04b18034642f3f6bae30bbd526ec7a99121 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTdFOkRBNzQ0OjEwMUNBQTg6MTVBQzQzNTo2QjAxMTlBMCIsInZpc2l0b3JfaWQiOiI4OTc3OTIxNjU4NDgwMzAyNDk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 42cfff5890c2d9a8b7eb74afaf1986f1f190aaed74d30f548e7cbb373f3273a4 |
| hovercard-subject-tag | issue:377046752 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/12859/issue_layout |
| twitter:image | https://opengraph.githubassets.com/da390d8d1ec00185c9ad9f2352dae44d7cc35272195af4838bfc49d75d7aced4/angular/angular-cli/issues/12859 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/da390d8d1ec00185c9ad9f2352dae44d7cc35272195af4838bfc49d75d7aced4/angular/angular-cli/issues/12859 |
| og:image:alt | Bug Report or Feature Request (mark with an x) - [ ] bug report -> please search issues before submitting - [X] feature request Command (mark with an x) - [ ] new - [X] build - [X] serve - [ ] test... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | woppa684 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width