nuxt-community / fontawesome-module

Module to use Font Awesome icons in Nuxt.js
MIT License
110 stars 12 forks source link

Don't deprecate `imports` option. #25

Open dvlden opened 3 years ago

dvlden commented 3 years ago

My suggestion is to not deprecate this option, but tweak it for a slightly different use.

For those that aren't aware all those that had the license for Font Awesome 5, can no longer install Font Awesome from their official npm repository. The license is not longer valid, but there's also a guide in the official docs where it is shown that you can download the .tar and host it somewhere privately for your personal use.

Since this breaks one of my projects and I do not wish to pay $100/y for Font Awesome v6, my only option is to follow that guide.

Hosting Font Awesome myself under my private Git repository of a project, under different scope. So without this imports option, I wouldn't be able to provide a set of the pro icons (v5) that are still valid.

I hope I was able to provide valuable information here. Please keep this option for such purposes.

For example, this is the config that I'm currently using:

fontawesome: {
    component: 'Fa',
    suffix: false,
    useLayers: false,
    useLayersText: false,
    icons: {
      brands: [
        'faCcVisa',
        'faCcMastercard',
        'faCcDiscover',
        'faCcAmex',
        'faCcPaypal',
        'faLinkedinIn',
        'faInstagram',
        'faTwitter'
      ]
    },
    imports: [
      {
        set: '@xxx/xxx-xxx-xxx',
        icons: [
          'faUsersCrown',
          // ...
        ]
      }
    ]
}
pimlie commented 3 years ago

What about using an webpack alias for fontawesome instead? If the only thing you need is to be able to use a local/custom import name then you could use that.

Maybe we can provide a simple/shortcut config option for that? This should work as import aliases would only ever be needed for pro icon sets (maybe the config key should indicate this):

fontawesome: {
  importAliases: {
    solid: '@xx/xxx-xx-xx'
  }