Alto Importmap builds, combines, renders, and resolves JavaScript import maps in PHP. It supports exact and prefix imports, scopes, integrity metadata, blocked entries, and module preloads.
<?php
use Alto\ImportMap\ImportMap;
$map = new ImportMap();
$map->add('app', '/assets/app.js');Documentation
- Installation: install the package and verify its requirements.
- Getting started: build and render a first import map.
- Imports: define and resolve exact, prefix, and scoped imports.
- Packages: load and combine maps contributed by packages.
- Output: generate safe import-map and module-preload tags.
- Caching: cache generated output without hiding map changes.
- Errors: recover from invalid entries, files, and resolutions.
The package represents import maps and returns HTML or resolution data. It does not download JavaScript modules, verify remote content, or write configuration files.