1. rollup-plugin-less
a rollup plugin for less files
rollup-plugin-less
Package: rollup-plugin-less
Created by: xiaofuzi
Last modified: Sun, 26 Jun 2022 13:59:58 GMT
Version: 1.1.3
License: ISC
Downloads: 18,500
Repository: https://github.com/xiaofuzi/rollup-plugin-less

Install

npm install rollup-plugin-less
yarn add rollup-plugin-less

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

  • 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|Boolean

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

  • 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.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code