一个fontawesome图标需要超过1MB?

时间:2019-02-21 12:25:45

标签: font-awesome

我使用的是fontawesome。 在light包中,我仅使用一个图标faCircle,但打包时需要1.5MB。有可能吗?

这里是分析: enter image description here

这是我的进口货。几乎所有图标都来自regular包:

import {dom, library} from '@fortawesome/fontawesome-svg-core';
import {
  faAddressCard,
  faAnalytics,
  faArchive,
  faArrowDown,
  faArrowFromLeft,
  faArrowFromRight,
  faArrowRight,
  faArrows,
  faArrowsAltV,
  faArrowToLeft,
  faArrowToRight,
  faArrowUp,
  faBan,
  faBars,
  faBox,
  faBoxCheck,
  faBoxUsd,
  faBriefcase,
  faBuilding,
  faCalculator,
  faCalendar,
  faCalendarCheck,
  faCalendarExclamation,
  faChartBar,
  faChartPie,
  faCheck,
  faCheckSquare,
  faChevronDoubleRight,
  faChevronDown,
  faChevronLeft,
  faChevronRight,
  faChevronUp,
  faClipboard,
  faClock,
  faCloudDownload,
  faCog,
  faCogs,
  faColumns,
  faCommentAltCheck,
  faCommentExclamation,
  faCommentPlus,
  faComments,
  faCompress,
  faCopy,
  faCreditCard,
  faDatabase,
  faDirections,
  faDownload,
  faEdit,
  faEllipsisH,
  faEnvelope,
  faEnvelopeOpenText,
  faExclamationCircle,
  faExpand,
  faExternalLink,
  faEye,
  faEyeSlash,
  faFile,
  faFileAlt,
  faFileArchive,
  faFileCsv,
  faFileExcel,
  faFileImage,
  faFilePdf,
  faFilePowerpoint,
  faFileSpreadsheet,
  faFilter,
  faFolder,
  faHandHoldingBox,
  faHistory,
  faHome,
  faHourglassHalf,
  faInbox,
  faInboxIn,
  faInboxOut,
  faInfinity,
  faInfo,
  faInfoCircle,
  faKey,
  faLightbulb,
  faList,
  faLock,
  faMagic,
  faMagnet,
  faMailBulk,
  faMale,
  faMap,
  faMapMarker,
  faMapMarkerSlash,
  faMinus,
  faMoneyBillAlt,
  faNewspaper,
  faPaperclip,
  faPencil,
  faPhone,
  faPlus,
  faPowerOff,
  faQuestion,
  faReply,
  faRetweetAlt,
  faSave,
  faSearch,
  faServer,
  faShare,
  faShareAlt,
  faShoppingCart,
  faSigma,
  faSignInAlt,
  faSignOutAlt,
  faSort,
  faSortDown,
  faSortUp,
  faStar,
  faStickyNote,
  faSyncAlt,
  faTable,
  faTachometerAlt,
  faTasks,
  faThList,
  faThumbsUp,
  faTimes,
  faTools,
  faTrash,
  faUndoAlt,
  faUpload,
  faUser,
  faUsers
} from '@fortawesome/pro-regular-svg-icons';
import {faCircle as faCircleEmpty} from '@fortawesome/pro-light-svg-icons';
import {faCircle} from '@fortawesome/pro-solid-svg-icons';
import {faGoogle} from '@fortawesome/free-brands-svg-icons';

const faInFirma = {
  prefix: 'fac',
  iconName: 'infirma',
  icon: [512, 512, [], 'e001', 'M367.967458,193.5l-23.50001,13.50001c0.00001,0.49999 -65.99999,-58.00001 -118,-53.00001c-52,5 -55.5,39.500009 -49,71.00001c6.5,31.5 14,63 64,111.5c50.00001,48.50001 97.50001,63.00001 119.50001,62.50001c22,-0.5 22.5,-1.5 29,-4c6.5,-2.5 8,-4.5 8,-4.5c0,0 59.49997,60.49998 61.99999,63.49999c2.50002,3.00001 -14.99998,42.50001 -80.49999,44.50001c-65.5,2 -162.50001,-44 -231.50001,-113c-69.00001,-69.00001 -100.50001,-130.00001 -103.50001,-213.00002c-3,-83.000009 62.500008,-97 90.500009,-100c28.000001,-3 85.000011,8.5 132.500011,39c47.5,30.5 68.99999,43.00001 100.5,82z M258.451949,258.000015l47.75001,-31.000008c0.249993,0.000007 81.249998,71.000011 105.75,36.500009c24.500001,-34.500002 -27.000002,-96.000006 -55.000004,-127.500008c-28.000001,-31.500002 -90.000005,-55.500003 -90.249997,-55.500005c0.249992,0.000002 -57.750012,-66.500002 -58.500002,-68.000003c0.000006,0.499993 46.500009,12.499994 106.500012,54.999997c60.000004,42.500002 129.000008,139.500008 141.000009,170.00001c12,30.500002 19.000001,75.500004 -3.5,94.000005c-22.500002,18.500001 -64.000004,8.000001 -90.500006,-2.5c-26.500001,-10.5 -64.500004,-41.000002 -71.500004,-45.000002c-7.000001,-4.000001 -31.500002,-25.500002 -31.750018,-25.999995z']
};


// ui
library.add(faBars, faQuestion, faEye, faEyeSlash, faColumns, faInfoCircle, faClipboard, faSave, faTrash, faPencil,
  faList, faStar, faHourglassHalf, faArchive, faEdit, faHome, faPowerOff, faTachometerAlt, faInfo, faExternalLink,
  faExpand, faCompress
);
// forms
library.add(faTimes, faCheck, faSearch, faFilter, faPlus, faRetweetAlt, faCheckSquare, faCopy);
// strzałki
library.add(
  faArrowFromLeft, faArrowToLeft, faArrowFromRight, faArrowToRight, faArrowsAltV, faArrows,
  faChevronUp, faChevronDown, faChevronLeft, faChevronRight, faChevronDoubleRight,
  faUndoAlt, faSyncAlt,
  faArrowRight, faArrowDown, faArrowUp,
  faShare
);
// sortowanie
library.add(faSort, faSortDown, faSortUp);
// obiekty
library.add(faBuilding, faBriefcase, faFolder, faMale, faUser, faUsers, faStickyNote, faBox, faBoxCheck, faBoxUsd, faPhone, faComments, faCommentPlus, faCommentExclamation, faEnvelope, faCalendar, faTasks, faInbox, faEnvelopeOpenText, faNewspaper, faLightbulb, faHistory, faShoppingCart, faMoneyBillAlt, faThumbsUp, faDatabase, faMagic, faHandHoldingBox);
// administrator
library.add(faCog, faCogs, faKey, faLock, faSignInAlt, faSignOutAlt);
// utils
library.add(faCloudDownload, faMap, faCircle, faCircleEmpty, faExternalLink, faDownload, faUpload, faShareAlt);
// maile
library.add(faPaperclip, faInboxIn, faInboxOut, faClock, faAddressCard, faBan, faExclamationCircle, faReply, faMagnet, faMailBulk);
// pliki
library.add(faFile, faFileCsv, faFileExcel, faFilePdf, faFileArchive, faFileAlt, faFileSpreadsheet, faFilePowerpoint, faFileImage);
// finanse
library.add(faCalculator, faSigma, faCreditCard);
// raporty
library.add(faTable, faThList, faChartBar, faChartPie);
// mapa
library.add(faDirections, faMapMarker, faMapMarkerSlash);
// zadania
library.add(faGoogle, faCalendarCheck, faCalendarExclamation, faCommentAltCheck);
// widżety
library.add(faEllipsisH, faTools, faServer, faInfoCircle, faMinus, faInfinity, faAnalytics);
// infirma
library.add(<any>faInFirma);

dom.watch();

0 个答案:

没有答案