1. rollup-plugin-less-loader
a rollup plugin for less files
rollup-plugin-less-loader
Package: rollup-plugin-less-loader
Created by: christlee1989
Last modified: Mon, 16 May 2022 04:28:26 GMT
Version: 0.2.1
License: ISC
Downloads: 54
Repository: https://github.com/christlee1989/rollup-plugin-less-loader

Install

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

说明

解决原版在多入口打包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.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin