esbuild plugin for less files.
yarn add esbuild-plugin-less -D
You can see the example here.
import { build } from 'esbuild';
import { lessLoader } from 'esbuild-plugin-less';
build({
entryPoints: [path.resolve(__dirname, 'index.ts')],
bundle: true,
outdir: path.resolve(__dirname, 'output'),
plugins: [lessLoader()], // Just plug in
loader: {
'.ts': 'ts',
},
});
lessLoader(lessOptions: Less.Options = {}, loaderOptions: LoaderOptions = {})
options
— Accepts all valid options from less.js. You can find a complete list of options here.loaderOptions
— Options for the loader. Supports custom esbuild filter.
esbuild-plugin-less
is WTFPL licensed.