node package manager

vcl-preprocessor

VCL preprocessor

Build Status Coverage Status

The VCL preprocessor allows to create builds from NPM based CSS modules. It is based on the rework processor framework.

Usage

Installation

$ npm install -g vcl-preprocessor

Command Line

Usage: vcl-preprocessor <input> [output]
 
Options:
  --version, -v              Show version number
  --help, -h                 Show help
  --watch, -w                watches the input file for changes
  --import-root, -i          directory for imports
  --direct-input             waits for input from stdin
  --include-dev              include dev dependencies of module          [default: true]
  --hoverSelectorPrefix, -p  specify a hover selector prefix, use '.vclHoverSupport' if no argument was provided
 
Examples:
  vcl-preprocessor index.styl dist/compiled.css     Compile index.styl and output to
                                                    dist/compiled.css
  cat index.styl | vcl-preprocessor > compiled.css  Compile index.styl and pipe
                                                    output to compiled.css
  vcl-preprocessor ./package.json > compiled.css    Fetch the package dependencies
                                                    and compile everything to
                                                    compiled.css

The vcl cli will create the destination directory if it does not exist.

API

var vcl = require('vcl-preprocessor');
 
// will return the finished css 
var css = vcl('body\n  color: blue').toString();
 
// will process a package including its dependencies 
// package needs to have a `style` property pointing to the main styl file 
var packCss = vcl.package('./my-page/package.json').toString();
 

This function will return the generated CSS code as string that can be written to a file for example.

Entry CSS File

The following ways to import CSS files are supported:

@import "node-module-name";
@import "node-module-name/file";
@import "./local-file-relative-to-this.css";

Features