title: How to send a npm package's static assets to a nuxt application?
body: <p><strong>I'm trying to send assets from an npm package to a nuxt application. Has anyone had success doing this?</strong></p>
  <p>I have an vue component as an npm package with stucture:</p>
  <pre><code>-src/
   -assets/
    -noun-filter.svg
  </code></pre>
  <p>This vector image is loaded in the vue component's template in this npm package like so:</p>
  <pre><code>&lt;img class=&quot;filter-icon&quot; :src=&quot;require('../assets/noun-filter.svg')&quot;/&gt;
  </code></pre>
  <p>The above works fine for use when testing this package on it's own.</p>
  <p>However when I import the npm package in a nuxt app like so:</p>
  <pre><code>&lt;script&gt;
  export default {
    name: &quot;NuxtMainPage&quot;,
    components: {
      NpmImportedComponent: process.client
        ? () =&gt; import(&quot;@myname/mynpmpackage&quot;).then(m =&gt; m.Content)
        : null
    },
  //...
  }
  &lt;/script&gt;
  </code></pre>
  <p>When I run the app I get a 404 for the svg.</p>
  <p>Nuxt looks for the file in <code>http://localhost:3000/_nuxt/img/noun-filter.b16c5666.svg</code> where it does not exist.</p>
  <p>Is there something I'm missing here? Why does nuxt change the path of the assets? Why is it not just looking in the node modules like we would expect?</p>
  <p><strong>How does one send static assets via an npm package to nuxt?</strong></p>
  <h3>What I've tried</h3>
  <ul>
  <li>Tried using url-loader in my app. Url's were still getting redirected in nuxt</li>
  <li>Import items with <code>import @myname/mypackage/src/assets/noun-filter.svg</code> in the nuxt app</li>
  <li>Switch the relative urls in npm package from <code>../assets</code> to <code>@assets</code></li>
  <li>Move the assets folder to the root of the npm package and add it to included files in package.json</li>
  </ul>
  <p>All of the above had the same result with nuxt looking for the image at:
  <code>http://localhost:3000/_nuxt/img/noun-filter.b16c5666.svg</code></p>