Stylus plugin for Craco.
Allows using Stylus .styl
files in create-react-app 4.x and also works with the craco-antd
plugin.
- CSS Module imports:
import styles from "./App.module.styl";
- Global imports:
import "./App.module.styl";
$ create-react-app my-app
$ cd my-app
$ yarn add @craco/craco stylus stylus-loader craco-stylus-loader
package.json
"scripts": {
- "start": "react-scripts start",
+ "start": "craco start",
- "build": "react-scripts build",
+ "build": "craco build",
- "test": "react-scripts test",
+ "test": "craco test",
},
craco.config.js
const CracoStylusLoaderPlugin = require("craco-stylus-loader");
module.exports = {
plugins: [
{
plugin: CracoStylusLoaderPlugin
}
]
};