# importmap-rails

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


Source: https://findsoftware.frbit.cloud/importmap-rails/
Last reviewed: 2026-10-28
Listed since: 2026-10-28

## Record

### Links

- repository: https://github.com/rails/importmap-rails
- docs: https://github.com/rails/importmap-rails/blob/v2.2.3/README.md

### Identity

- status: active
- maintainer: Basecamp
- maintainerType: unknown
- parent: unknown
- firstRelease: 2021
- hqCountry: unknown

### Kind

- category: build-tool
- hosting: not applicable
- language: ruby
- runtime: ruby
- runtimeMin: ruby 3.1
- basedOn: rails

### Content

- contentStore: not applicable
- databases: not applicable
- adminUi: not applicable
- headlessApi: not applicable
- templating: not applicable
- i18n: not applicable

### Rendering and deploy

- runsAs: unknown
- renderingModes: not applicable
- installMethod: bundler, then rails generator importmap:install

### License

- licenseModel: open-source
- license: MIT

### Releases

- currentMajor: 2
- latestReleaseDate: 2026-01-07

### Adoption

- githubStargazers: 1165
- packagistDownloads: not applicable
- npmWeeklyDownloads: not applicable
- contributors: 62
- pluginCount: unknown
- packagistMonthlyDownloads: unknown
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 15822
- dependentPackages: 44

### Sources

- urls: https://api.github.com/repos/rails/importmap-rails (read 2026-10-28)
- urls: https://github.com/rails/importmap-rails/blob/v2.2.3/README.md (read 2026-10-28)
- maintainer: https://github.com/rails/importmap-rails/blob/v2.2.3/MIT-LICENSE (read 2026-10-28)
- language: https://api.github.com/repos/rails/importmap-rails (read 2026-10-28)
- basedOn: https://github.com/rails/importmap-rails/blob/v2.2.3/README.md (read 2026-10-28)
- category: https://api.github.com/repos/rails/importmap-rails (read 2026-10-28)
- runtime: https://github.com/rails/importmap-rails/blob/v2.2.3/importmap-rails.gemspec (read 2026-10-28)
- runtimeMin: https://github.com/rails/importmap-rails/blob/v2.2.3/importmap-rails.gemspec (read 2026-10-28)
- installMethod: https://github.com/rails/importmap-rails/blob/v2.2.3/README.md (read 2026-10-28)
- license: https://github.com/rails/importmap-rails/blob/v2.2.3/importmap-rails.gemspec (read 2026-10-28)
- licenseModel: https://github.com/rails/importmap-rails/blob/v2.2.3/MIT-LICENSE (read 2026-10-28)
- firstRelease: https://rubygems.org/api/v1/versions/importmap-rails.json (read 2026-10-28)
- currentMajor: https://rubygems.org/api/v1/gems/importmap-rails.json (read 2026-10-28)
- latestReleaseDate: https://rubygems.org/api/v1/gems/importmap-rails.json (read 2026-10-28)
- githubStargazers: https://api.github.com/repos/rails/importmap-rails (read 2026-10-28)
- contributors: https://api.github.com/repos/rails/importmap-rails/contributors (read 2026-10-28)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/rubygems.org/packages/importmap-rails (read 2026-10-28)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/rubygems.org/packages/importmap-rails (read 2026-10-28)

## Notes

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.

---

Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attributes are recorded, never scored; absent means unknown.
Credit, in full: FindSoftware, CC BY 4.0
