nuxt-community / fontawesome-module

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

Usage of Pro Icons #15

Closed xavism closed 4 years ago

xavism commented 4 years ago

I've added the fontawesome token to be able to download the pro icons and I've added this packages as dev dependencies:

    "@fortawesome/fontawesome-pro": "^5.13.0",
    "@fortawesome/free-solid-svg-icons": "^5.13.0",
    "@fortawesome/pro-duotone-svg-icons": "^5.13.0",
    "@fortawesome/pro-light-svg-icons": "^5.13.0",
    "@fortawesome/pro-regular-svg-icons": "^5.13.0",
    "@fortawesome/pro-solid-svg-icons": "^5.13.0",
    "@nuxtjs/fontawesome": "^1.1.2",

but this error appears when trying to use a light icon (PRO icon)

 ERROR  Failed to compile with 1 errors                                                                                                                                                                                  

This dependency was not found:                                                                                                                                                                                          

* @fortawesome/free-light-svg-icons in ./.nuxt/fontawesome.js                                                                                                                                                            

To install it, you can run: npm install --save @fortawesome/free-light-svg-icons 

This is the fontawesome config in nuxt.config

  fontawesome: {
    icons: {
      light: ['faAbacus']
    }
  },
xavism commented 4 years ago

Not sure if bug or bad usage, probably the second one but no idea how to solve it

pimlie commented 4 years ago

@xavism To use the pro packages you need to use the proIcons options. See https://github.com/nuxt-community/fontawesome-module#proicons

Creating the import path is a simple string concat, it uses free for everything under icons and pro for everything under proIcons :)

xavism commented 4 years ago

Thanks for the response @pimlie I didn't understand the documentation :( Now it works perfectly !