CoreUI icons package is huge!

How can I reduce the bundle size of the icons package?

I’m just importing these ones:

//icons.js    
import {
      cilEnvelopeClosed,
      cilEnvelopeOpen,
      cilMagnifyingGlass,
      cilMoon,
      cilSpeedometer,
      cilSun,
      cilAccountLogout,
      cilUser,
      cilXCircle,
      cilX,
    } from '@coreui/icons'

import { logo } from './logo'

export const iconsSet = Object.assign({}, { logo }, {
  cilEnvelopeClosed,
  cilEnvelopeOpen,
  cilMagnifyingGlass,
  cilMoon,
  cilSpeedometer,
  cilSun,
  cilAccountLogout,
  cilUser,
  cilXCircle,
  cilX,
})

//main.js
import { iconsSet as icons } from './assets/icons/icons.js'
...
...
...
new Vue({
  el: '#app',
  router,
  store,
  icons
  components: {
    App
  },
  template: '<App/>',
  apolloProvider: createProvider(),
})

Answered here:

1 Like