Skip to content

Craco plugin to use base64-inline-loader with create-react-app version >= 2

License

Notifications You must be signed in to change notification settings

melMass/craco-base64-inline-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Craco Base64 Inline Loader

MIT License

This is a craco plugin that makes it easy to use the webpack base64-inline-loader with create-react-app version >= 2.

Installation

$ yarn add -D craco-base64-inline-loader

# OR

$ npm install craco-base64-inline-loader --save-dev

Basic Usage

craco-base64-inline-loader expect a test option containing your regex selector.

Here is a simple craco.config.js example to convert every font types to base64:

const base64Loader = require('craco-base64-inline-loader')

module.exports = {
  webpack: {
    plugins: [
     { plugin: base64Loader,
       options: {
         test: /\.(ttf|eot|otf|svg|woff(2)?)$/i ,
         limit: 1000 // <-- Optional
         }
     }
    ]
  }
}

About

Craco plugin to use base64-inline-loader with create-react-app version >= 2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published