Less Plugin

Description

Handles Less CSS pre-processor files.

Install

yarn add less --dev
// OR
npm install less --save-dev

Usage

check Less website for more information.

Note

The less plugin generates CSS, Therefor it must be chained prior to the CSSPlugin to be used.

Setup

Import from FuseBox

const {LESSPlugin} = require("fuse-box");

Inject into a chain.

fuse.plugin(
     [LESSPlugin(), CSSPlugin()]
)

Or add it to the main config plugins list to make it available across bundles.

FuseBox.init({
    plugins : [
         [LESSPlugin(), CSSPlugin()]
    ]
});

Require file in your code

import "./styles/main.less"

Options

LessPlugin accepts a key/value Less object options as a parameter. For example:

fuse.plugin(
    [LESSPlugin({
        paths: [path.join(__dirname, 'less', 'includes')]
    }), CSSPlugin()]
)

Note

Sourcemaps are not yet properly handled. Development is ongoing on this feature