Add installation instructions for importmap-rails

This commit is contained in:
Sam Power 2022-06-06 12:52:08 -04:00
parent 889c87773c
commit 6a674db689
1 changed files with 14 additions and 0 deletions

View File

@ -32,6 +32,20 @@ manage your JavaScript dependencies, there is no need to install Node.js or Yarn
When using import maps, no separate build process is required, just start your server with
`bin/rails server` and you are good to go.
### Installing importmap-rails
Importmap for Rails is automatically included in Rails 7+ for new applications, but you can also install it manually in existing applications:
```bash
$ bin/bundle add importmap-rails
```
Run the install task:
```bash
$ bin/rails importmap:install
```
### Adding NPM Packages with importmap-rails
To add new packages to your import map-powered application, run the `bin/importmap pin` command