gobem-proc-stylus

0.0.9 • Public • Published

gobem-proc-stylus

This processor for gobem compiles Stylus files using stylus and nib. All options are passed as a single object. gobem-proc-stylus requires directory to cache results of the work.

The following options are supported:

  • commonStylus
    A path to common file, which will be included to the beginning of each file. Different common files for different languages are supported. This feature is useful to define variables and mixins, which are the same throughout all project.
  • noNib
    If this flag is true, nib won't be included in each file.
  • cacheDir
    Full path to a readable and writable directory to cache files.

Example for build.js

module.exports = function () {
    var cacheDir = '/var/www/gobem/cache';
 
    return [
 
        ['select', 0, /^components\/(\w+)\/\1\.styl$/],
        ['gobem-proc-stylus', {
            noNib: true,
            cacheDir: cacheDir
        }],
        ['write', 1],
        // compiles stylus without using nib
 
        // buildLangs = [''];
        ['select', 0, /^styles\/button\/button\.styl$/],
        ['gobem-proc-stylus', {
            commonStylus: 'styles/common/common.styl',
            cacheDir: cacheDir
        }],
        ['write', 1]
        // content from 'styles/common/common.styl' will be added
        // to the beginning of 'styles/button/button.styl'
 
        // buildLangs = ['', 'ru', 'en'];
        ['select', 0, /^styles\/slider\/slider:en\.styl$/],
        ['gobem-proc-stylus', {
            commonStylus: 'styles/common/common.styl',
            cacheDir: cacheDir
        }],
        ['write', 1]
        // content from 'styles/common/common.styl' and
        // 'styles/common/common:en.styl' will be added
        // to the beginning of 'styles/slider/slider:en.styl'
 
    ]; // this array will be used as build instructions
};

Dependents (0)

Package Sidebar

Install

npm i gobem-proc-stylus

Weekly Downloads

0

Version

0.0.9

License

GPL-3.0

Last publish

Collaborators

  • enet