A Babel 6 plugin that compiles Stylus (.styl) files into CSS strings during build, enabling CSS imports in JavaScript. Current version 1.4.0. It supports importing stylus files as variables or as style tag injection. Key differentiators: simple Babel integration, automatic dependency resolution from node_modules, and built-in autoprefixer (since v1.3.0). However, it is designed for Babel 6 and may not work with Babel 7+ without compatibility adjustments. Not actively maintained, last release in 2017.
npm install babel-plugin-stylus-compilerVerified import paths — ran on the pinned version, not inferred.
Demonstrates installing the plugin, configuring Babel, and importing a Stylus file as a CSS string or injecting it as a style tag.
Upgrade to a Babel 7 compatible plugin (e.g., styled-jsx or custom webpack loader) or stay on Babel 6.
Consider using a more modern build tool like webpack with stylus-loader and postcss-loader.
Ensure file extensions are .styl exactly.
Use a different tool (e.g., CSS Modules with webpack) if scoped styles are needed.
Run: npm install stylus --save-dev
Downgrade to Babel 6 or use a modern alternative.
Ensure @babel/preset-env or babel-preset-env is set up.