compile-mw-less

0.1.1 • Public • Published

Compile-Middleware-LESS

LESS middleware built on compile-middleware.

Usage

var lessware = require('compile-mw-less');

app.use(lessware({
    filename  : /(?:\/styles\/)(.*)\.css/i, // Capture group 1 will be used
    src       : '/path/to/source',
    maxAge    : 86400                       // Optional, HTTP Cache Control MaxAge
    // Render Options to LESS Parser, Optional
    compress  : 'auto',
             // 'auto' will turn compress on compress when requested file 
             // ends with .min.css or -min.css
             // Other optional value are: true/false, default 'auto'
    yuicompress: false,                     // YUICompress, off by default
    optimization: 0,                        // Specify LESS optimize level
    dumpLineNumbers: 0,                     // LESS.js debug option
    paths     : []
             // Specify LESS include paths, src path will be added automatically
}));

Refer to compile-middleware#Usage for more information.

For information about less render options, please refer lesscss.org.

WARNING No not add a g flag to the RegExp, that will broke the filename extraction procedure. It's an V8 Issue

License

Copyright 2013 Shinohane<imandry.c@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    1
  • 0.0.1
    0

Package Sidebar

Install

npm i compile-mw-less

Weekly Downloads

1

Version

0.1.1

License

Apache License v2.0

Last publish

Collaborators

  • shinohane