https://github.com/skovy/webpack-tree-shaking-demo
Example of tree shaking Font Awesome in a simple webpack app
https://github.com/skovy/webpack-tree-shaking-demo
font-awesome tree-shaking webpack
Last synced: about 2 months ago
JSON representation
Example of tree shaking Font Awesome in a simple webpack app
- Host: GitHub
- URL: https://github.com/skovy/webpack-tree-shaking-demo
- Owner: skovy
- Created: 2019-08-04T18:39:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-04T20:33:56.000Z (almost 7 years ago)
- Last Synced: 2025-02-02T01:26:39.963Z (over 1 year ago)
- Topics: font-awesome, tree-shaking, webpack
- Language: JavaScript
- Size: 1.09 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🌳 webpack tree shaking demo
This repository is simple webpack application with a few key dependencies and
how tree shaking can impact the overall bundle size:
- `react` & `react-dom`
- `lodash`
- `@fortawesome/fontawesome-svg-core`
- `@fortawesome/free-solid-svg-icons`
- `@fortawesome/react-fontawesome`
## Setup
After cloning this repository, change directories to the example app you'd
like to see. For example:
- `cd basic`
- `yarn install`
- `yarn build`
- _(open `dist/index.html` in a browser)_
### `basic`
The [`basic`](/basic) directory contains the basics of an application with all of these
dependencies and renders a simple component. This app **does not** tree shake
the excess Font Awesome icons.
### `import-only-used`
The [`import-only-used`](/import-only-used) directory updates the basic example
to import only the icons used and add them to the Font Awesome library.
### `explicit-import`
The [`explicit-import`](/explicit-import) directory updates the basic example
to explicitly import the icons that are used and doesn't create a Font Awesome
library.
---
See the [Font Awesome - Tree Shaking](https://fontawesome.com/how-to-use/with-the-api/other/tree-shaking)
docs for more details around tree shaking Font Awesome.