xiaofuzi / rollup-plugin-less

a less rollup plugin
22 stars 23 forks source link
less rollup-plugin

Install

npm install rollup-plugin-less --save

usage

import './test.less';
//generate css will be auto insert to the head tag if you set insert be true
import { rollup } from 'rollup';
import less from 'rollup-plugin-less';

rollup({
    entry: 'main.js',
    plugins: [
        less()
    ]
});

Options

insert

If you specify true, the plugin will insert compiled CSS into <head/> tag.

output

If you specify a string, it will be the path to write the generated CSS. If you specify a function, call it passing the generated CSS as an argument. If you specify a boolean, true will write the generated CSS to rollup.build.css, false won't write the file.

include

Minimatch pattern or array of minimatch patterns to determine which files are transpiled by the plugin.

exclude

Minimatch pattern or array of minimatch patterns to determine which files are explicitly not transpiled by the plugin, overrules the include option.

option

Options for less.