larvitcss

Used to compile, minify, autoprefix etc CSS to remove the need to precompile css

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
larvitcss
020.7.1024 days ago8 years agoMinified + gzip package size for larvitcss in KB

Readme

Build Status
larvitcss
Compile, minify, autoprefix etc css from a folder. This module is designed to remove the need to precomile css.
Uncompiled files, like .scss, .sass, .less, .stylus etc overrides precompiled .css files with a conflicting name.
The callback is always called, and req.finished is set to true when no file is found.

Installation

npm i larvitcss;

Usage

For usage as middleware in for instance Express or larvitbase:
const larvitcss = require('larvitcss');
const { Log } = require('larvitutils');
const express = require('express');
const app = express();

app.use(larvitcss({
	log: new Log(), // Optional
	basePath: 'my_path/public', // Optional, defaults to "public/" under current process path,
	notFoundController: (req, res) => { // Optional, controller for file not found, default to setting 404 status code.
		res.statusCode = 404;
		res.end('File not found from special controller');
	},
}));

const larvitcss = require('larvitcss');
const { Log } = require('larvitutils');
const LBase = require('larvitbase');
const lBase = new LBase({middlewares: [larvitcss()]});

Development mode

Set environment variable LARVITCSSNOCACHE to disable cache
Changelog

0.6.0

  • Removed larvitfs functionality. basePath is not specified instead and larvitcss is used as a middleware.