FreeNowOrg / PixivNow

Provide Pixiv backend proxy & frontend service based on serverless technology

Home Page:https://pixiv.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

drop `@fortawesome/*`

dragon-fish opened this issue · comments

PixivNow/src/main.ts

Lines 21 to 27 in 4b85565

// FontAwesome
// https://fontawesome.com/v5.15/icons
import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(fas)
app.component('fa', FontAwesomeIcon)

任选一种方案皆可

  • 换用 @vicons/fa
  • 不换依赖,改成按需导入
  • 也可以找其他方案,比如换成 auto import(好像 NaiveUI 社区有人提出了 @vicons/fa 的 auto import 的脚本)

目前全量导入 fontawesome-svg-core 导致入口文件非常巨大,流量有点扛不住

目前以使用unplugin-icons的方式解决了全量导入icons的问题,暂时没发现什么问题。