Closed seandan7 closed 3 years ago
@seandan7 Maybe a webpack alias could work?
@pimlie That worked swimmingly!
@seandan7, could you please share your config for how you did it?
@vakrolme I don't work where I used this code anymore. I should have commented it here.
I believe it was something like this: nuxt.config.js
module.exports = {
build: {
extend (config) {
config.resolve.alias['@fontawesome']= path.join(this.options.srcDir, 'fontawesome-local')
}
}
}
With all of your local downloaded files in that directory.
Thanks @seandan7. I used nuxt's own alias property instead:
import { resolve } from 'path';
export default {
...
alias: {
'@fortawesome/free-regular-svg-icons': resolve(__dirname, 'assets/icons/fontawesome-local/free-regular-svg-icons'),
},
...
}
It's also important not to confuse which type of distribution you should put there, it should be js-packages, not js, so the directory you point to must feature index.js and a separate file for each icon, rather than all.js. That's why nothing worked for me until I figured it out.
Are there any examples or suggestions for the nuxt.config setup if using self-hosted fontAwesome packages? I noticed that if purchasing a pro license and not renewing, the icons will no longer be available via .npmrc and the app will break.
Is there any known solution for this?