Stylus is an Expressive, dynamic and robust CSS preprocessor. This chapter introduces how to use Stylus in Builder.
You can install the plugin with the following command:
In upper-level frameworks such as Modern.js, you can register Stylus plugin through the builderPlugins
config:
When you call the Builder's Node API directly, you can register Stylus plugin with the addPlugins
method:
After installing the plugin, you can directly import *.styl
or *.module.styl
files into the code without adding other configs.
normalize.styl
:title.module.styl
:index.js
:If you need to customize the compilation behavior of Stylus, you can use the following configs.
-Type:
undefined
Options passed to Stylus, please refer to the Stylus documentation for specific usage.
boolean
isDev
Whether to generate Source Map, enabled by default in the development environment.