0.6.3 • Published 4 years ago

@vcl/preprocessor v0.6.3

Weekly downloads
4
License
MIT
Repository
-
Last release
4 years ago

VCL preprocessor

Build Status Coverage Status

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

Installation

$ npm install -g @vcl/preprocessor

Usage

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          base directory for file based imports
  --optimize                 optimize css
  --source-map              generate source maps

Examples:
  vcl-preprocessor index.sss dist/compiled.css     Compile index.sss and output to
                                                    dist/compiled.css

The VCL CLI will create the destination directory if it does not exist.

API

var vcl = require('@vcl/preprocessor');

// Will compile the input file and store the result in the output file
vcl(inputFile, outputFile, opts).then(({css}) => {
  ...
});

// Will compile the input file and store the result in the output file
// Also recompiles the output file on changes
vcl.compileFile(inputFile, outputFile, opts);

// Will return an array of postCSS plugins
var plugins = vcl.createPostCSSPlugins(opts);

// Will create a webpack rule for .sss files
var rule = vcl.createWebpackSSSRule(opts);

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

Options

  • root process.cwd() base directory for file based imports.
  • sourceMap false creates a source map
  • optimize false optimizes css
  • watch false enables watch mode
  • include [] includes for the webpack rule
  • exclude [] excludes for the webpack rule

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

0.7.0-alpha.3

4 years ago

0.7.0-alpha.1

4 years ago

0.6.3

4 years ago

0.6.2

5 years ago

0.6.0-6

5 years ago

0.6.0-1

5 years ago

0.5.3

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.0

5 years ago

0.4.0-beta.3

5 years ago

0.4.0-beta.2

5 years ago

0.4.0-beta.1

5 years ago

0.4.0-beta.0

5 years ago

0.4.0-4

5 years ago

0.4.0-3

5 years ago

0.4.0-2

5 years ago

0.4.0-1

5 years ago

0.4.0-0

5 years ago

0.3.0-16

5 years ago

0.3.0-15

5 years ago

0.3.0-14

5 years ago

0.3.0-13

5 years ago

0.3.0-12

5 years ago

0.3.0-11

5 years ago

0.3.0-10

5 years ago

0.3.0-9

5 years ago

0.3.0-8

5 years ago

0.3.0-7

5 years ago

0.3.0-6

5 years ago

0.3.0-4

5 years ago

0.3.0-3

5 years ago

0.3.0-2

5 years ago

0.3.0-1

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

7 years ago