diff --git a/README.md b/README.md index ecd94b641..99c047b60 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,36 @@ These routes then need to be added to the routes file for the parent tools/utils Simply adding the routes to one of thes files above will register the tool/util with the application and will display the new component. +### Lazy loading and code splitting + +When loading a route component, please use the `lazyLoad()` method defined in the application lib. + +| param | description| +| ----- | ---------- | +| `moduleImport: () => Promise` | Function which imports the desired module | +| `namedExport?: string` | The name of the exported module (if the module has named exports) | + +Eg: +``` +// Lazy load the WelcomePage component +const WelcomePage: LazyLoadedComponent = lazyLoad(() => import('./welcome'), 'WelcomePage') +... +// Use the component as route element +export const learnRoutes: Array = [ + { + children: [ + { + children: [], + element: , + ... + }, + ... + ] + } +] +``` + + ### Platform Route The PlatformRoute model has several useful options: diff --git a/public/global.css b/public/global.css index cbe37a3b9..333d293f7 100644 --- a/public/global.css +++ b/public/global.css @@ -1,7 +1,3 @@ -@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"); -@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"); -@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); - body { background-color: #f4f5f6; font-family: Roboto, Arial, Helvetica, sans-serif; diff --git a/public/index.html b/public/index.html index da3a59318..7df78700f 100644 --- a/public/index.html +++ b/public/index.html @@ -8,9 +8,10 @@ - - - + + + +