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()],
loader: {
'.ts': 'ts',
},
});
More information about watch mode here.
import { build } from 'esbuild';
import { lessLoader } from 'esbuild-plugin-less';
build({
watch: true, // enable watch mode
entryPoints: [path.resolve(__dirname, 'index.ts')],
bundle: true,
outdir: path.resolve(__dirname, 'output'),
plugins: [lessLoader()],
loader: {
'.ts': 'ts',
},
});
lessLoader
accepts all valid options from less.js. You can find a complete list of options here.
LoaderOptions
loader options, support custom filter
{
filter: /\.less$/,
}
esbuild-plugin-less
is WTFPL licensed.