UNPKG

1.2 kBMarkdownView Raw
1## Install
2
3```node
4npm install rollup-plugin-less --save
5```
6
7## usage
8
9```js
10import './test.less';
11//generate css will be auto insert to the head tag if you set insert be true
12```
13
14```js
15import { rollup } from 'rollup';
16import less from 'rollup-plugin-less';
17
18rollup({
19 entry: 'main.js',
20 plugins: [
21 less()
22 ]
23});
24```
25
26
27## Options
28
29### insert
30
31+ Default: `false`
32+ Type: `Boolean`
33
34If you specify `true`, the plugin will insert compiled CSS into `<head/>` tag.
35
36### output
37
38+ Default: `rollup.build.css`
39
40+ Type: `String|Function`
41
42If you specify a string, it will be the path to write the generated CSS.
43If you specify a function, call it passing the generated CSS as an argument.
44
45### include
46
47+ Default: `[ '**/*.less', '**/*.css' ]`
48
49+ Type: `String|Array`
50
51Minimatch pattern or array of minimatch patterns to determine which files are transpiled by the plugin.
52
53### exclude
54
55+ Default: `node_modules/**`
56
57+ Type: `String|Array`
58
59Minimatch pattern or array of minimatch patterns to determine which files are explicitly not transpiled by the plugin, overrules the `include` option.
60
61### option
62
63+ Type: `Object`
64
65Options for [less](http://lesscss.org/usage/#programmatic-usage).