hauxir / esbuild-plugin-less

esbuild plugin for less files

Home Page:https://npmjs.com/package/esbuild-plugin-less

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License: WTFPL TypeScript code style: prettier npm version David David Codecov FOSSA Status semantic-release

esbuild-plugin-less

esbuild plugin for less files

Install

yarn add esbuild-plugin-less -D

Usage

Simple example

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',
  },
});

Watch mode

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',
  },
});

Options

lessLoader accepts all valid options from less.js. You can find a complete list of options here.

License

esbuild-plugin-less is WTFPL licensed.

FOSSA Status

About

esbuild plugin for less files

https://npmjs.com/package/esbuild-plugin-less

License:Do What The F*ck You Want To Public License


Languages

Language:TypeScript 95.7%Language:Less 3.1%Language:CSS 1.2%