craco-plugin-scoped-css
Version:
This is a craco plugin that adds scoped css support to create-react-app version >= 2 (this package is part of [react scoped css solution](https://github.com/gaoxiaoliangz/react-scoped-css))
36 lines (23 loc) • 1.09 kB
Markdown
This is a craco plugin that adds scoped css support to create-react-app version >= 2 (this package is part of [react scoped css solution](https://github.com/gaoxiaoliangz/react-scoped-css))
First, follow the [`craco` Installation Instructions](https://github.com/sharegate/craco/blob/master/packages/craco/README.md##installation) to install the `craco` package, create a `craco.config.js` file, and modify the scripts in your `package.json`.
Then install `craco-plugin-scoped-css`:
```bash
$ yarn add craco-plugin-scoped-css
$ npm i -S craco-plugin-scoped-css
```
Here is a complete `craco.config.js` configuration file that adds react-scoped-css to `create-react-app`:
```js
module.exports = {
plugins: [
{
plugin: require('craco-plugin-scoped-css'),
},
],
}
```
Check out [simple-scoped-css-example](https://github.com/gaoxiaoliangz/react-scoped-css/tree/master/examples/simple)