FindSoftware

importmap-rails

Ruby gem that adds import maps to Rails so JavaScript ES modules load in the browser without transpiling or bundling.

importmap-rails is a Ruby gem that adds import maps to Rails, so the browser loads JavaScript ES modules directly. The application’s config/importmap.rb pins logical module names to local files or CDN URLs, and the layout helper javascript_importmap_tags writes the map into the page. The ./bin/importmap command downloads npm packages from a CDN into vendor/javascript, where they are served by the asset pipeline.

The README presents this as an approach that avoids transpiling and bundling, so an application ships many small files instead of one bundle. Rails 7 and later include the gem by default in new applications.

Worth knowing

Subresource integrity is opt-in: the gem adds hashes only after enable_integrity! is called in the importmap configuration, and Propshaft needs an integrity algorithm set in the application.

Identity

Status
Active
Maintainer
Basecamp3
First release
20215

Rendering and deploy

Install with
bundler, then rails generator importmap:install2

Releases

Current major version
26
Last release
2026-01-076

Adoption

GitHub stars
1,1651
Contributors
627
Dependent repositories
15,8228
Dependent packages
448

Why these figures do not compare

Sources

  1. 2026-10-28: links, Written in, Categories, GitHub stars
    api.github.com/repos/rails/importmap-rails
  2. 2026-10-28: links, Built on, Install with
    github.com/rails/importmap-rails/blob/v2.2.3/README.md
  3. 2026-10-28: Maintainer, License model
    github.com/rails/importmap-rails/blob/v2.2.3/MIT-LICENSE
  4. 2026-10-28: Runtime, Minimum runtime, License
    github.com/rails/importmap-rails/blob/v2.2.3/importmap-rails.gemspec
  5. 2026-10-28: First release
    rubygems.org/api/v1/versions/importmap-rails.json
  6. 2026-10-28: Current major version, Last release
    rubygems.org/api/v1/gems/importmap-rails.json
  7. 2026-10-28: Contributors
    api.github.com/repos/rails/importmap-rails/contributors
  8. 2026-10-28: Dependent packages, Dependent repositories
    packages.ecosyste.ms/api/v1/registries/rubygems.org/packages/importmap-rails

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON