title: Can Font Awesome be used with importmaps in Rails 7?
body: <p>I'm new to Rails 7's importmap and the <a href="https://github.com/rails/importmap-rails" rel="nofollow noreferrer">documentation says</a> you can pin a JavaScript module and then import it:</p>
  <pre class="lang-sh prettyprint-override"><code>./bin/importmap pin react react-dom
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>import React from &quot;react&quot;
  import ReactDOM from &quot;react-dom&quot;
  </code></pre>
  <p>How would that work with Font Awesome? Font Awesome's documentation says you <a href="https://fontawesome.com/docs/web/setup/packages" rel="nofollow noreferrer">should install the package</a>:</p>
  <pre><code>npm install --save @fortawesome/fontawesome-free
  </code></pre>
  <p>but then, when it comes to using it, it says:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script defer src=&quot;/your-path-to-fontawesome/js/brands.js&quot;&gt;&lt;/script&gt;
  &lt;script defer src=&quot;/your-path-to-fontawesome/js/solid.js&quot;&gt;&lt;/script&gt;
  &lt;script defer src=&quot;/your-path-to-fontawesome/js/fontawesome.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>I'm not entirely clear how to translate that to importmap. I tried:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script defer src=&quot;https://ga.jspm.io/npm:@fortawesome/fontawesome-free@6.0.0/js/brands.js&quot;&gt;&lt;/script&gt;
  &lt;script defer src=&quot;https://ga.jspm.io/npm:@fortawesome/fontawesome-free@6.0.0/js/solid.js&quot;&gt;&lt;/script&gt;
  &lt;script defer src=&quot;https://ga.jspm.io/npm:@fortawesome/fontawesome-free@6.0.0/js/fontawesome.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>since the pinning resulted in:</p>
  <pre class="lang-rb prettyprint-override"><code>pin &quot;@fortawesome/fontawesome-free&quot;, to: &quot;https://ga.jspm.io/npm:@fortawesome/fontawesome-free@6.0.0/js/fontawesome.js&quot;
  </code></pre>
  <p>but that doesn't work. It fails with this error in the console in the browser:</p>
  <p><a href="https://i.stack.imgur.com/U9AWO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U9AWO.png" alt="enter image description here" /></a></p>