Angular
-
Install the package:
Terminal window npm install aeo.js -
Add a post-build step to your
package.json:{"scripts": {"postbuild": "node -e \"import('aeo.js/angular').then(m => m.postBuild({ title: 'My App', url: 'https://myapp.com' }))\""}} -
Build your app:
Terminal window npm run build
How it works
Section titled “How it works”The Angular plugin:
- Reads
angular.jsonto auto-detect the output directory (dist/<project>/browser/) - Scans route config files (
*.routes.ts) and component directories for routes - Scans pre-rendered HTML from the build output for full page content
- Injects the widget into
index.htmlautomatically
Programmatic usage
Section titled “Programmatic usage”You can also generate AEO files from source routes without building:
import { generate } from 'aeo.js/angular';
await generate({ title: 'My App', url: 'https://myapp.com' });Configuration
Section titled “Configuration”Pass any AeoConfig options to postBuild or generate:
import { postBuild } from 'aeo.js/angular';
await postBuild({ title: 'My App', url: 'https://myapp.com', generators: { robotsTxt: true, llmsTxt: true, schema: true, },});