Multi-Page
Build several pages into separate bundles, set up two ways: as entries in lynx.config.ts, or as one Angular project per page in angular.json.
Entries in lynx.config.ts
source.entry— each key,mainandsettings, becomes its own bundle:main.lynx.bundleandsettings.lynx.bundle.- A bootstrap file per page —
src/main.tsandsrc/pages/settings/main.tseach callbootstrapApplication()with their own root component and config. - Independent apps — the pages share no router or state. The host app (Glossary) opens each bundle on its own.
Projects in angular.json
- A project per page —
angular.jsondefineshomeandsettingsapplication projects, each with its ownbrowserentry file. pages: 'all'—pluginAngularLynx({ pages: 'all' })builds every application project as a page, with its bundle named after the project. Passpages: ['home', 'settings']to pick specific ones.- One build for every page —
ng build homebuilds both pages.
Related
- Multi-page apps
- Session Storage, to share state between pages
@blotch/angular-lynx-build
