1.0.1 • Published 8 months ago

@mikekasprzak/esbuild-plugin-less v1.0.1

Weekly downloads
-
License
WTFPL
Repository
github
Last release
8 months ago

License: WTFPL TypeScript code style: prettier npm version npm version libraries.io 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.

LoaderOptions loader options, support custom filter

{
  filter: /\.less$/,
}

License

esbuild-plugin-less is WTFPL licensed.

FOSSA Status

1.0.1

8 months ago