Skip to content
a less rollup plugin
JavaScript CSS HTML
Branch: master
Clone or download
Pull request Compare This branch is 4 commits ahead, 13 commits behind xiaofuzi:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.babelrc
.editorconfig
.eslintrc
.gitignore
.npmignore
README.md
package.json
rollup.config.js

README.md

说明

解决原版在多入口打包CSS的情况下的BUG

Install

npm install rollup-plugin-less-loader --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-loader';

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

Options

insert

  • Default: false
  • Type: Boolean

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

output

  • Default: rollup.build.css

  • Type: String|Function

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.

include

  • Default: [ '**/*.less', '**/*.css' ]

  • Type: String|Array

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

exclude

  • Default: node_modules/**

  • Type: String|Array

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

option

  • Type: Object

Options for less.

You can’t perform that action at this time.