Skip to content

karolis-sh/esbuild-postcss

Repository files navigation

esbuild-postcss

npm version Node.js CI License: MIT

Seamless integration between esbuild and PostCSS.

Installation

npm i postcss esbuild-postcss -D

or

yarn add postcss esbuild-postcss --dev

Usage

const esbuild = require('esbuild');
const postcss = require('esbuild-postcss');

esbuild
  .build({
    entryPoints: ['style.css'],
    bundle: true,
    outdir: 'build',
    plugins: [postcss()],
  })
  .catch(() => process.exit(1));

Options

extensions

Type: string[]
Default: ['.css']

This plugin will process files ending with these extensions.