Meteor Stylus Autoprefixer
A custom Meteor build plugin for compiling Stylus (.styl
) files into CSS, automatically adding vendor prefixes with Autoprefixer, and supporting Hot Module Replacement (HMR) for an enhanced development experience.
Installation
To add the plugin to your Meteor project, use the following command:
meteor add chatra:stylus-autoprefixer
Ensure that the standard-minifier-css
package is installed to handle CSS minification in production:
meteor add standard-minifier-css
Usage
Once installed, the plugin automatically processes all .styl
files in your Meteor project. No additional configuration is required for basic usage.
Configuration
For advanced configurations, you can create a stylus.config.js
file in the root of your Meteor project. This file allows you to customize paths, global imports, and additional Stylus compilation options.
Example stylus.config.js
1const path = require('path'); 2 3module.exports = { 4 // Paths to search for files when using @import 5 includePaths: [ 6 path.join(process.cwd(), 'client/styles/stylus/'), 7 path.join(process.cwd(), 'shared/styles/'), 8 ], 9 10 // Files to automatically import in every Stylus file 11 importFiles: ['vars', 'mixins'], 12 13 // Additional Stylus compilation options 14 stylusOptions: { 15 'include css': true, // Allow importing plain CSS files 16 }, 17};
License
This package is licensed under the MIT License.