Title: Update the lazy loading information to CLI and v6 · Issue #24109 · angular/angular · GitHub
Open Graph Title: Update the lazy loading information to CLI and v6 · Issue #24109 · angular/angular
X Title: Update the lazy loading information to CLI and v6 · Issue #24109 · angular/angular
Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [x] Documentation issue or request [ ] Support request => Please do not submi...
Open Graph Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [x] Documentation issue or request [ ...
X Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [x] Documentation issue or reques...
Opengraph URL: https://github.com/angular/angular/issues/24109
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update the lazy loading information to CLI and v6","articleBody":"\u003c!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" -->\r\n\u003cpre>\u003ccode>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[ ] Bug report \u003c!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Performance issue\r\n[ ] Feature request\r\n[x] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n[ ] Other... Please describe:\r\n\u003c/code>\u003c/pre>\r\n\r\n## Current behavior\r\nCurrent documentation shows non-relative paths being used for `loadChildren`\r\n```\r\n {\r\n path: 'customers',\r\n loadChildren: 'app/customers/customers.module#CustomersModule'\r\n },\r\n```\r\n\r\nWhile this can work, it depends on the tsconfig `baseUrl` configuration. \r\n\r\nIn Angular CLI 1.x we had a baseUrl of `src/`, which made sense for single apps. Angular CLI 6.x adds multi project and library support, and as part of that we changed the `baseUrl` to be `./`.\r\n\r\nThis was done because having a `baseUrl` pointing to a specific project affects path resolution in all projects. Having multiple `baseUrl` is also problematic because your app interprets paths in tsconfig in one way, and your lib in another way. And your editor in yet another way because `tsconfig.app.json` is not recognized by the editor.\r\n\r\nFor a non-relative path to a lazy route to work, now it would have to include `src/`: `loadChildren: 'src/app/orders/orders.module#OrdersModule'`.\r\n\r\nTo avoid confusion on the CLI we always used relative paths, since we didn't know what baseUrl users had in their configs.\r\n\r\n\r\n## Expected behavior\r\nI suggest examples use relative paths, thus not depending on any `baseUrl` configuration on user projects:\r\n```\r\n {\r\n path: 'customers',\r\n loadChildren: './customers/customers.module#CustomersModule'\r\n },\r\n```\r\n\r\nIt would also be beneficial to add a note about how using non-relative paths works but they are based off `baseUrl`.\r\n\r\n## What is the motivation / use case for changing the behavior?\r\nShow instructions for lazy modules that work in a newly generated CLI 6.x project.\r\n\r\nRelated to https://github.com/angular/angular-cli/issues/10673#issuecomment-391801112\r\n\r\ncc @brandonroberts ","author":{"url":"https://github.com/filipesilva","@type":"Person","name":"filipesilva"},"datePublished":"2018-05-24T18:37:42Z","url":"https://github.com/angular/angular/issues/24109"}
| 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:1d5b3521-c2f6-f4b1-d70e-b3b29bf1002f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B5EE:B53AF:109D0CC:1622060:6B01150A |
| html-safe-nonce | c7af506e8b258230a007cdb6b1ac493caae4d835632e693f547a5750961cce6a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUVFOkI1M0FGOjEwOUQwQ0M6MTYyMjA2MDo2QjAxMTUwQSIsInZpc2l0b3JfaWQiOiIyNjkwNDM4NTUwNDczNzQxNTc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 610e42957ca6fa4881dcf012dc6b5fb871bcb2feeb525d0767183c49075c4439 |
| hovercard-subject-tag | issue:326242095 |
| 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/24109/issue_layout |
| twitter:image | https://opengraph.githubassets.com/327efa7fa4b030d4ea3face90d2a108870354fee4e55ef969e0511819e3f65a3/angular/angular/issues/24109 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/327efa7fa4b030d4ea3face90d2a108870354fee4e55ef969e0511819e3f65a3/angular/angular/issues/24109 |
| og:image:alt | I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [x] Documentation issue or request [ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | filipesilva |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width