Registry / devops / broccoli-less-single

broccoli-less-single

JSON →
library2.0.1jsnpmunverified

A Broccoli plugin that compiles a single primary LESS input file into a single CSS output file, handling @import dependencies. Current stable version is 2.0.1 (last release February 2017). It uses less.js under the hood and focuses on single-file output, unlike broccoli-less which compiles each LESS file individually. Key differentiator: supports imports and produces one output CSS file from multiple input files via LESS imports. The plugin is in maintenance mode with no recent updates.

npm install broccoli-less-single
INSTALL
IMPORT
SIG · BROCCOLI-LESS-SING
B
broccoli-less-single
devopsjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compileLess
const compileLess = require('broccoli-less-single');
import compileLess from 'broccoli-less-single';
The package uses CommonJS; ESM import is not supported out of the box.
compileLess
const { default: compileLess } = await import('broccoli-less-single');
If using ESM, dynamic import is needed to get the default export.
compileLess (as a named export)
const { compileLess } = require('broccoli-less-single');
import { compileLess } from 'broccoli-less-single';
Named export is not provided; only a default export exists. Use default import style.

Shows how to use broccoli-less-single with broccoli-funnel and broccoli-merge-trees to compile a single LESS file to CSS with caching.

const Funnel = require('broccoli-funnel'); const compileLess = require('broccoli-less-single'); const mergeTrees = require('broccoli-merge-trees'); const appTree = new Funnel('app', { destDir: '.' }); const lessTree = compileLess( [appTree], 'styles/app.less', 'assets/app.css', { paths: ['.'], cacheInclude: [/.*\.(css|less)$/], cacheExclude: [] } ); module.exports = mergeTrees([appTree, lessTree]);
Debug
Known issues
breakingIn version 0.5.0, the options hash passed to compileLess is now cloned to avoid mutation of the original object. If you relied on the hash being mutated, your code may break.
fix
Do not rely on side effects on the options object; pass a fresh object each time.
affects: >=0.5.0 <=2.0.1
deprecatedThe plugin is no longer actively maintained. Last release was in 2017. Consider migrating to a modern alternative like 'broccoli-less' or 'webpack' with LESS loader.
fix
Use alternative solutions that are actively maintained.
affects: all
gotchaThe package does not support ESM imports natively. Attempting 'import compileLess from ...' may fail in Node.js versions that strictly require ESM.
fix
Use require() or dynamic import.
affects: all
gotchaThe 'inputNodes' must be an array even if you have only one node. Passing a single node object will cause an error.
fix
Wrap a single node in an array: compileLess([node], ...).
affects: all
gotchaOutput file path must be relative and will be created relative to the Broccoli output tree. Absolute paths will not work.
fix
Use relative paths like 'assets/app.css'.
affects: all
Errors
Common errors & fixes
Error: The 'broccoli-less-single' plugin does not exist. Did you mean 'broccoli-less'?
Typo or confusion with similar package name 'broccoli-less'.
fix
Ensure you have installed 'broccoli-less-single' and require it correctly: const compileLess = require('broccoli-less-single');
TypeError: compileLess is not a function
Using ESM import incorrectly or forgetting to call require.
fix
Use const compileLess = require('broccoli-less-single');
Error: inputNodes must be an array
Passing a single node object instead of an array.
fix
Wrap the node in an array: compileLess([node], ...)
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
broccoli-caching-writerrequiredRequired for caching logic to avoid expensive rebuilds
lessrequiredCore LESS compiler (peer dependency, but also listed as dependency)
Agent activity
5 hits · last 30 days
node
4
Resources
broccoli-less-single — npm install broccoli-less-single · libregistry