Cweili / svelte-fa

Tiny FontAwesome component for Svelte

Home Page:https://cweili.github.io/svelte-fa/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use exaclty

PlkMarudny opened this issue · comments

I tried to add the section displayed below to the rollup.config.js, copied from docs/ directory, but getting the following error:

ReferenceError: SvelteFa is not defined (in bundle.js)
globals: {
      'svelte-fa': 'SvelteFa',
    },
  },
  external: ['svelte-fa'],

How is the exact way of using the library?

@PlkMarudny

The docs loaded svelte-fa as a external library.

Based on your rollup.config.js, you can choose any of the following ways:

1. As a external library

Add <script> in your html.

<script src="https://cdn.jsdelivr.net/npm/svelte-fa@2"></script>

2. Install as a dependency

npm install svelte-fa

And remove external declaration from your rollup.config.js.

// remove this
globals: {
    'svelte-fa': 'SvelteFa',
  },
},
external: ['svelte-fa'],

Closing due to inactivity.