Skip to content

Babel plugin for using Font Awesome with React Native

Notifications You must be signed in to change notification settings

LouisIV/fix-font-awesome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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';

About

Babel plugin for using Font Awesome with React Native

Resources

Stars

Watchers

Forks

Packages

No packages published