less-loader

Webpack loader that compiles Less stylesheets into CSS

Tool
npm
v13.0.0
958stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
60/100Good
Development Activity48
Maintenance32
Community72
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
70/100Good
Architecture72
Code Quality78
Innovation55
Learning Curve75

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

Low Code Platforms · Databases

15,526

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

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
56%
MIT

Jitsu

Data Engineering

5,035

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

View details
89
Repo Health
79
Technical
68
Dependency
Built with
TypeScript56%
Go41%
Updated today
PHP
48%
AGPL 3.0

Leantime

Productivity · Project Management · Collaboration

11,391

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

View details
90
Repo Health
68
Technical
67
Dependency
Built with
PHP48%
CSS20%
Blade17%
Updated 4 days ago
PHP
79%
GPL 3.0

matomo

Analytics

21,786

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
PHP79%
Updated today
Python
45%
Other

Redash

Analytics · Data Engineering

28,754

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
85
Repo Health
74
Technical
61
Dependency
Built with
Python45%
JavaScript31%
TypeScript17%
Updated yesterday
Python
58%
Other

Sentry

Security · Developer Tools · Monitoring

44,574

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
70
Dependency
Built with
Python58%
TypeScript41%
Updated today
TypeScript
95%
GPL 3.0

Wire

Team Chat · Video Conferencing · Collaboration

1,190

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
74
Dependency
Built with
TypeScript95%
Updated today

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

Search