less-loader

Webpack loader that compiles Less stylesheets into CSS

Tool
npm
v13.0.0
960 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
66 /100 Good
Development Activity 56
Maintenance 48
Community 72
Maturity 60
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
70 /100 Good
Architecture 72
Code Quality 78
Innovation 55
Learning Curve 75

less-loader plugs the Less CSS preprocessor into a webpack build pipeline, letting you import/require .less files directly in your JavaScript and have them compiled to plain CSS at build time. It’s designed to sit in a loader chain alongside css-loader and style-loader (or MiniCssExtractPlugin in production), matching the standard pattern webpack projects use for every CSS preprocessor.

Beyond basic compilation, it supports passing arbitrary Less options (lessOptions), injecting shared variables or mixins into every entry (additionalData), toggling source maps independently of webpack’s devtool setting, swapping the underlying Less implementation for testing version upgrades, and resolving @imports through either Less’s native resolver or webpack’s own module resolution (so @import '~some-package/file.less'-style imports work against node_modules).

What You Get

  • A webpack loader that compiles Less syntax to CSS during the build
  • lessOptions for passing any Less CLI option (as an object or a function of the loader context)
  • additionalData to prepend/append shared Less code (e.g. environment variables) to every processed file
  • Configurable source map generation independent of webpack’s global devtool setting
  • A webpackImporter option to resolve @imports through webpack’s module resolution against node_modules

Common Use Cases

  • Compiling Less-based component or theme stylesheets in a webpack-bundled frontend app
  • Overriding shared Less variables per environment via additionalData without maintaining multiple stylesheet copies
  • Importing Less partials from installed npm packages using webpack’s resolver instead of relative paths

Under The Hood

Architecture The loader’s core (src/index.js) receives the raw Less source string from webpack, merges user-supplied lessOptions with defaults ({ relativeUrls: true }), resolves the appropriate Less implementation (locally installed, or an explicit implementation override), and invokes Less’s render() API asynchronously, returning the compiled CSS (and source map, when enabled) back into the webpack loader chain; src/utils.js centralizes option normalization and the dual Less/webpack import-resolution logic, and src/options.json is a JSON Schema used to validate loader options at build time. Tech Stack Implemented in plain JavaScript against the standard webpack loader API (this.async(), this.emitFile, loaderContext), with less itself as a peer dependency so a project’s installed Less version (3.x or 4.x) drives behavior, and klona/schema-utils used internally for option cloning and validation. Code Quality The project has an extensive test/ directory with fixture-based snapshot tests covering options like additionalData, sourceMap, webpackImporter, and error/warning propagation, run through webpack’s own test harness; CI enforces linting and coverage reporting on every change, consistent with the other loaders in the webpack org (css-loader, sass-loader) that share this architecture. API Design Options follow the same shape convention used across the webpack loader ecosystem (options object validated against a JSON Schema, sync or async functions accepted where relevant), which keeps the learning curve low for anyone who has configured sass-loader or postcss-loader before; the one Less-specific wrinkle documented in the README is that Less doesn’t map all its CLI flags 1-to-1 to camelCase, requiring occasional cross-referencing with the Less CLI source.

Used by 7 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 1 months ago
TypeScript
62%
MIT

Jitsu

Data Engineering

5,094

Open-source, fully-scriptable data ingestion engine that streams events from web, apps, and APIs to any data warehouse in real time.

View details
88
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 62%
Go 36%
Updated 2 weeks ago
PHP
48%
AGPL 3.0

Leantime

Collaboration · Productivity · Project Management

11,672

Project management built for ADHD, autism, and dyslexia — simple as Trello, powerful as Jira

View details
90
Repo Health
68
Technical
65
Dependency
Built with
PHP 48%
CSS 20%
Blade 17%
Updated 2 weeks ago
PHP
78%
GPL 3.0

matomo

Analytics

21,905

Open-source, privacy-first web and app analytics that puts you in complete control of your data.

View details
95
Repo Health
82
Technical
62
Dependency
Built with
PHP 78%
Updated 1 weeks ago
Python
46%
Other

Redash

Analytics · Data Engineering

28,817

Redash lets anyone connect to 35+ SQL and NoSQL data sources, write a query in the browser, and turn the result into a shared dashboard — no separate BI suite required.

View details
92
Repo Health
74
Technical
60
Dependency
Built with
Python 46%
JavaScript 30%
TypeScript 17%
Updated 1 weeks ago
Python
57%
Other

Sentry

Analytics · Developer Tools · Monitoring

44,862

Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.

View details
95
Repo Health
80
Technical
69
Dependency
Built with
Python 57%
TypeScript 41%
Updated 1 weeks ago
TypeScript
96%
GPL 3.0

Wire

Collaboration · Team Chat · Video Conferencing

1,192

Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.

View details
93
Repo Health
8
Technical
71
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers