@rockmandash/font-subset

1.0.6 • Public • Published

font-subset

Faster font load time by subsetting fonts.

Requirement

Need create-react-app v2!

yarn add @rockmandash/font-subset yarn add import-all.macro emotion react-emotion lodash

pip install fonttools pip install Brotli

Usage

First, modify npm scripts "build": "subset-font && react-scripts build",

then just import fonts in the top of index.js file import "@rockmandash/font-subset/NotoSansTC"

production

process.env.NODE_ENV === 'production'; font-subset will search all js/css/html files in src/ directory, retrieve all unique chinese words, and create new subset fonts.

development

process.env.NODE_ENV === 'development'; font-subset will serve whole fonts.

Readme

Keywords

none

Package Sidebar

Install

npm i @rockmandash/font-subset

Weekly Downloads

7

Version

1.0.6

License

MIT

Unpacked Size

40.7 MB

Total Files

29

Last publish

Collaborators

  • rockmandash