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.

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
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.
npm install snowpack-plugin-stylus
yarn add snowpack-plugin-stylus
pnpm add snowpack-plugin-stylus

Configures Snowpack to compile .styl files via the Stylus plugin with custom render options.

// snowpack.config.js
module.exports = {
  plugins: [
    [
      'snowpack-plugin-stylus',
      {
        // Optional Stylus render options (e.g., compress, use, define)
        compress: true,
        // define: { $primary: '#09f' }
      }
    ]
  ]
};