Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@visallo/requirejs-less
Advanced tools
LESS loader plugin for RequireJS with builds, based on RequireCSS
Note: This project is not currently actively supported and is seeking a maintainer.
Optimizable LESS requiring with RequireJS
Based on the ideas from require-css module, read the documentation there for further usage instructions.
Allows the construction of scripts that can require LESS files, using the simple RequireJS syntax:
define(['less!styles/main'], function() {
//code that requires the stylesheet: styles/main.less
});
When run the in the browser, less is downloaded, parsed and injected. When running a build with the RequireJS optimizer, less is compiled into the build layers dynamically as css with compression support, or into a separate file with the separateCSS
build option.
By default LESS URIs are normalized relative to the base LESS.
URIs can be made relative to the individual LESS files with the global LESS configuration:
<script>window.less = { relativeUrls: true }</script>
Download the require-less folder manually or use Bower:
bower install require-less
Then add the following package configuration in RequireJS:
map: {
'*': {
'less': 'require-less/less' // path to less
}
}
Package configuration can also be used here alternatively.
Before running a build, install the LESS NodeJS module and csso for compression:
npm install less csso
NOTE: If you are running the optimizer globally, use npm install less csso -g
.
The RequireCSS build system is used to build LESS. The exact same options thus apply.
Example build configuration:
{
modules: [
{
include: ['mymodule'], // where mymodule is dependent on a less! include
exclude: ['require-css/normalize'],
}
]
}
This inlines all compiled LESS required by mymodule
into the build layer for dynamic injection.
To build into a separate CSS file:
separateCSS: true,
modules: [
{
include: ['mymodule'], // where mymodule is dependent on a less! include
exclude: ['require-css/normalize'],
}
]
The separateCSS
build option can then be used to create this CSS layer as a separate file. See the RequireCSS documentation for more information.
Compilation options can be set with the less
configuration option in the RequireJS config:
requirejs.config({
less: {
// ... custom LESS compiler options ...
// for example: relativeUrls: true
}
});
MIT
FAQs
LESS loader plugin for RequireJS with builds, based on RequireCSS
The npm package @visallo/requirejs-less receives a total of 1 weekly downloads. As such, @visallo/requirejs-less popularity was classified as not popular.
We found that @visallo/requirejs-less demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.