@thedanbob/esbuild-plugin-postcss
v1.0.1
Published
Plugin for esbuild to support postcss
Readme
(Forked from the original plugin by Dean Clatworthy)
esbuild-plugin-postcss
Plugin for esbuild to support PostCSS
Install
npm i @thedanbob/esbuild-plugin-postcss --save-devUsage example
Create file src/test.css:
input[type="text"] {
border-radius: 1px;
}Create file src/index.js:
import "./test.css"Create file build.js:
import esbuild from "esbuild"
import autoprefixer from "autoprefixer"
import postCssPlugin from "@thedanbob/esbuild-plugin-postcss"
esbuild
.build({
entryPoints: ["src/index.js"],
bundle: true,
outfile: "bundle.js",
plugins: [
postCssPlugin({
filter: /\.css$/, // Default
plugins: [autoprefixer()] // Defaults to [], in which case the plugin does nothing
})
]
})
.catch((e) => console.error(e.message))Run:
node build.jsOutputs file named bundle.css with appropriate postcss plugins applied.
Requirements
- Node.js 22+
