Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.06 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.06 KB

npm version

Blog Post

Installation

npm i -D @louislombardo/babel-plugin-fix-font-awesome

In your babel config:

module.exports = {
  presets: ["module:metro-react-native-babel-preset"],
  plugins: ["@louislombardo/babel-plugin-fix-font-awesome"],
}

Fix Font Awesome

This is a Babel plugin aimed at transforming imports from Font Awesome to reduce React Native bundle sizes

This:

import { faBadgeCheck } from '@fortawesome/pro-solid-svg-icons';
import { faCheck, faCalendar as proCalendarIcon } from '@fortawesome/pro-regular-svg-icons';

Becomes this:

import { faBadgeCheck } from '@fortawesome/pro-solid-svg-icons/faBadgeCheck';
import { faCheck } from '@fortawesome/pro-regular-svg-icons/faCheck';
import { faCalendar as proCalendarIcon } from '@fortawesome/pro-regular-svg-icons/faCalendar';