Skip to content

Commit abbbf19

Browse files
authored
Update a guide about explanation related to es-module-shims (rails#51369)
1 parent 30e3738 commit abbbf19

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

guides/source/asset_pipeline.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,14 @@ All of the configured import maps should be attached in `<head>` element of your
141141
</script>
142142
```
143143

144-
- [`Es-module-shims`](https://github.com/guybedford/es-module-shims) acting as polyfill ensuring support for `import maps` on older browsers:
145-
146-
```html
147-
<script src="/assets/es-module-shims.min" async="async" data-turbo-track="reload"></script>
148-
```
149-
150144
- Entrypoint for loading JavaScript from `app/javascript/application.js`:
151145

152146
```html
153147
<script type="module">import "application"</script>
154148
```
155149
150+
NOTE: Before v2.0.0, `importmap-rails` put [`Es-module-shims`](https://github.com/guybedford/es-module-shims) in the output of `javascript_importmap_tags` as a polyfill to ensure support for import maps on older browsers. However, with the native support for import maps in all major browsers, v2.0.0 has dropped the bundled shim. If you want to support legacy browsers that lack support for import maps, manually insert `Es-module-shims` before `javascript_importmap_tags`. For more information, refer to [README for importmap-rails](https://github.com/rails/importmap-rails?tab=readme-ov-file#supporting-legacy-browsers-such-as-safari-on-ios-15).
151+
156152
### Using npm packages via JavaScript CDNs
157153
158154
You can use the `bin/importmap` command that's added as part of the `importmap-rails` install to pin, unpin, or update npm packages in your import map. The binstub uses [`JSPM.org`](https://jspm.org/).

0 commit comments

Comments
 (0)