A craco plugin to use Linaria v2 zero-runtime CSS in JS library in a Create React App.
First, follow craco's installation instructions.
Then, install craco-linaria
and
Linaria v2:
$ npm install --save-dev craco-linaria linaria
/* craco.config.js */
const CracoLinariaPlugin = require('craco-linaria')
module.exports = {
plugins: [
{
plugin: CracoLinariaPlugin,
options: {
// Linaria options
},
},
],
}
You can specify Linaria options inline (as above) or it will be picked up from any of the supported configuration paths.
This plugin stores Linaria cache in src/.linaria_cache
, so you might want
to add that path to your .gitignore
file.