rollup-plugin-bundle-less
raw JSON → 0.0.7 verified Mon Apr 27 auth: no javascript maintenance
A Rollup plugin that bundles imported LESS files into a single LESS output file at version 0.0.7. It works by specifying an entry LESS file (default styles.less), then inlining all @import statements recursively into one bundled file. This plugin targets only LESS preprocessing, not full compilation to CSS. It is a thin wrapper around less-bundle and has no active releases since initial publish; use with caution as it may lack maintenance for modern Rollup versions or advanced features.
Common errors
error Cannot find module 'less-bundle' ↓
cause Missing dependency less-bundle not installed automatically.
fix
Run 'npm install less-bundle' alongside this plugin.
error TypeError: lessBundler is not a function ↓
cause Used named import instead of default import, or used require without .default.
fix
Use default import: import lessBundler from 'rollup-plugin-bundle-less'
error Error: Cannot read properties of undefined (reading 'src') ↓
cause Plugin called without options object.
fix
Provide options object, e.g., lessBundler({ src: 'styles.less' })
Warnings
gotcha Plugin does not compile LESS to CSS; output remains .less file. ↓
fix Use rollup-plugin-less or rollup-plugin-postcss if you need CSS output.
gotcha Options 'source' and 'destination' are silently ignored; use 'src' and 'dest'. ↓
fix Correct option keys: src, dest.
breaking Unmaintained since 2019; may not work with Rollup >=3. ↓
fix Test compatibility or consider alternative plugins.
Install
npm install rollup-plugin-bundle-less yarn add rollup-plugin-bundle-less pnpm add rollup-plugin-bundle-less Imports
- default wrong
import { lessBundler } from 'rollup-plugin-bundle-less'correctimport lessBundler from 'rollup-plugin-bundle-less' - options (src, dest) wrong
lessBundler({ source: 'app.less', destination: 'dist/main.less' })correctlessBundler({ src: 'app.less', dest: 'dist/main.less' }) - CommonJS require wrong
const lessBundler = require('rollup-plugin-bundle-less')correctconst lessBundler = require('rollup-plugin-bundle-less').default
Quickstart
import lessBundler from 'rollup-plugin-bundle-less';
export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'esm'
},
plugins: [
lessBundler({
src: 'src/styles.less',
dest: 'dist/bundled.less'
})
]
};