Esbuild Plugin Postcss • A CSS loader plugin for esbuild that uses postcss as preprocessor.
Install
npm i @chialab/esbuild-plugin-postcss -D
yarn add @chialab/esbuild-plugin-postcss -D
Usage
import esbuild from 'esbuild';
import postcssPlugin from '@chialab/esbuild-plugin-postcss';
await esbuild.build({
plugins: [
postcssPlugin(),
],
});
This plugin looks for a postcss configuration in the project and fallbacks to out custom postcss-preset-env.
Sass
The plugin automatically tries to load the @chialab/postcss-plugin-dart-sass
when it processes .scss
files. Please make sure to have installed the optional dependency in order to correctly transpiler Sass files:
npm i @chialab/postcss-plugin-dart-sass -D
yarn add @chialab/postcss-plugin-dart-sass -D
License
Esbuild Plugin Postcss is released under the MIT license.