Plugin for esbuild
to import .less
files in JavaScript or TypeScript.
npm i @arnog/esbuild-plugin-less
// In your JS file:
import style from "style.less";
console.log(style);
// In your esbuild build file:
import { build } from "esbuild";
import { less } from "@arnog/esbuild-plugin-less";
build({
entryPoints: ["index.js"],
bundle: true,
outfile: "build/index.js",
plugins: [less()],
});
You can pass to the less()
function an option object literal as described here.
This plugin was inspired from @iam-medvedev/esbuild-plugin-less.