Snowpack Plugin Stylus
raw JSON → 1.0.6 verified Fri May 01 auth: no javascript
A Snowpack plugin that compiles .styl files into CSS using the Stylus preprocessor. Version 1.0.6 is the latest stable release, with no update cadence reported. It integrates into Snowpack's build pipeline, supporting custom Stylus render options. Compared to other Stylus plugins for different bundlers, this is specific to Snowpack and requires minimal configuration.
Common errors
error Cannot find module 'stylus' ↓
cause Stylus peer dependency not installed
fix
npm install --save-dev stylus
error [snowpack] Plugin "snowpack-plugin-stylus" not found ↓
cause Plugin package not installed
fix
npm install --save-dev snowpack-plugin-stylus
Warnings
gotcha Stylus must be installed as a peer dependency; missing it causes build errors. ↓
fix Run 'npm install --save-dev stylus'
deprecated Snowpack is in maintenance mode; consider migrating to other build tools. ↓
fix Use Vite or another build system with its own Stylus support.
Install
npm install snowpack-plugin-stylus yarn add snowpack-plugin-stylus pnpm add snowpack-plugin-stylus Imports
- snowpack-plugin-stylus wrong
import snowpackPluginStylus from 'snowpack-plugin-stylus'correctAdd to Snowpack config as a plugin string or array (see quickstart)
Quickstart
// snowpack.config.js
module.exports = {
plugins: [
[
'snowpack-plugin-stylus',
{
// Optional Stylus render options (e.g., compress, use, define)
compress: true,
// define: { $primary: '#09f' }
}
]
]
};