Skip to content

Commit

Permalink
fix(font-awesome): fix font-awesome requires to import to reduce main…
Browse files Browse the repository at this point in the history
… bundle size

reduces from 1+mb to 81kb

fixes: #126
  • Loading branch information
MarkPieszak committed Apr 19, 2019
1 parent 1df09c6 commit 634dcdf
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions content/ClientApp/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@ import { library } from '@fortawesome/fontawesome-svg-core'
// Official documentation available at: https://github.com/FortAwesome/vue-fontawesome
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

import { faEnvelope, faHeart, faGraduationCap, faHome, faInfo, faList, faSpinner } from '@fortawesome/free-solid-svg-icons'
import { faFontAwesome, faMicrosoft, faVuejs } from '@fortawesome/free-brands-svg-icons'

// If not present, it won't be visible within the application. Considering that you
// don't want all the icons for no reason. This is a good way to avoid importing too many
// unnecessary things.
library.add(
require('@fortawesome/free-solid-svg-icons').faEnvelope,
require('@fortawesome/free-solid-svg-icons').faHeart,
require('@fortawesome/free-solid-svg-icons').faGraduationCap,
require('@fortawesome/free-solid-svg-icons').faHome,
require('@fortawesome/free-solid-svg-icons').faInfo,
require('@fortawesome/free-solid-svg-icons').faList,
require('@fortawesome/free-solid-svg-icons').faSpinner,
faEnvelope,
faHeart,
faGraduationCap,
faHome,
faInfo,
faList,
faSpinner,

// Brands
require('@fortawesome/free-brands-svg-icons').faFontAwesome,
require('@fortawesome/free-brands-svg-icons').faMicrosoft,
require('@fortawesome/free-brands-svg-icons').faVuejs
faFontAwesome,
faMicrosoft,
faVuejs
)

export {
Expand Down

0 comments on commit 634dcdf

Please sign in to comment.