gilest/phoenix_importmap: Use ESM with importmap to efficiently serve JavaScript without transpiling or bundling.
SMRTR summary
Phoenix Importmap allows developers to use ES/JS Modules efficiently without bundling or transpiling. It supports shipping multiple small JavaScript files instead of one large file and is natively supported in major modern browsers. The package can be installed by adding phoenix_importmap to the dependencies in mix.exs. Configuration involves updating the asset watcher, adding an importmap, and modifying the app.js script tag. This approach simplifies JavaScript management and improves load times for web applications.
SMRTR provides this summary for quick context. The original article belongs to Daily.dev.
Read the original article