Skip to content

Commit

Permalink
client: Use deep imports for plug-ins
Browse files Browse the repository at this point in the history
Parcel’s tree shaking is shaky:

#1013 (comment)
  • Loading branch information
jtojnar committed Oct 5, 2019
1 parent c97695e commit 9a1ccb9
Showing 1 changed file with 43 additions and 24 deletions.
67 changes: 43 additions & 24 deletions assets/js/icons.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
'use strict';

import { fab } from '@fortawesome/free-brands-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';
import { fas } from '@fortawesome/free-solid-svg-icons';
// Icons must be imported deeply because Parcel’s tree shaking is shaky.
import { faDiaspora } from '@fortawesome/free-brands-svg-icons/faDiaspora';
import { faFacebookSquare } from '@fortawesome/free-brands-svg-icons/faFacebookSquare';
import { faGetPocket } from '@fortawesome/free-brands-svg-icons/faGetPocket';
import { faTwitter } from '@fortawesome/free-brands-svg-icons/faTwitter';
import { faWordpressSimple } from '@fortawesome/free-brands-svg-icons/faWordpressSimple';
import { faCheckCircle as faCheckCircleRegular } from '@fortawesome/free-regular-svg-icons/faCheckCircle';
import { faStar as faStarRegular } from '@fortawesome/free-regular-svg-icons/faStar';
import { faTimesCircle } from '@fortawesome/free-regular-svg-icons/faTimesCircle';
import { faArrowAltCircleDown } from '@fortawesome/free-solid-svg-icons/faArrowAltCircleDown';
import { faArrowRight } from '@fortawesome/free-solid-svg-icons/faArrowRight';
import { faCheckCircle } from '@fortawesome/free-solid-svg-icons/faCheckCircle';
import { faCloudUploadAlt } from '@fortawesome/free-solid-svg-icons/faCloudUploadAlt';
import { faCog } from '@fortawesome/free-solid-svg-icons/faCog';
import { faEnvelope } from '@fortawesome/free-solid-svg-icons/faEnvelope';
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons/faExternalLinkAlt';
import { faKey } from '@fortawesome/free-solid-svg-icons/faKey';
import { faSearch } from '@fortawesome/free-solid-svg-icons/faSearch';
import { faSignOutAlt } from '@fortawesome/free-solid-svg-icons/faSignOutAlt';
import { faStar } from '@fortawesome/free-solid-svg-icons/faStar';
import { faSyncAlt } from '@fortawesome/free-solid-svg-icons/faSyncAlt';
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
import { library, dom } from '@fortawesome/fontawesome-svg-core';
import wallabag from '../images/wallabag';

Expand All @@ -18,27 +37,27 @@ export default function initIcons() {
};

library.add(
fab.faDiaspora,
fab.faFacebookSquare,
fab.faGetPocket,
fab.faTwitter,
fab.faWordpressSimple,
far.faCheckCircle,
far.faStar,
far.faTimesCircle,
fas.faArrowAltCircleDown,
fas.faArrowRight,
fas.faCheckCircle,
fas.faCloudUploadAlt,
fas.faCog,
fas.faEnvelope,
fas.faExternalLinkAlt,
fas.faKey,
fas.faSearch,
fas.faSignOutAlt,
fas.faStar,
fas.faSyncAlt,
fas.faTimes,
faDiaspora,
faFacebookSquare,
faGetPocket,
faTwitter,
faWordpressSimple,
faCheckCircleRegular,
faStarRegular,
faTimesCircle,
faArrowAltCircleDown,
faArrowRight,
faCheckCircle,
faCloudUploadAlt,
faCog,
faEnvelope,
faExternalLinkAlt,
faKey,
faSearch,
faSignOutAlt,
faStar,
faSyncAlt,
faTimes,
wallabagIcon
);

Expand Down

0 comments on commit 9a1ccb9

Please sign in to comment.