@johnie/esbuild-plugin-postcss

1.0.0 • Public • Published

(Forked version of @deanc/esbuild-plugin-postcss with personal modification)

esbuild-plugin-postcss

Node.js CI

Plugin for esbuild to support PostCSS

Install

npm i esbuild esbuild-plugin-postcss

Usage example

Create file src/test.css:

input[type="text"] {
  border-radius: 1px;
}

Create file src/index.js:

import "./test.css";

Create file build.js:

const esbuild = require("esbuild");
const autoprefixer = require("autoprefixer");
const postCssPlugin = require("esbuild-plugin-postcss");

esbuild
  .build({
    entryPoints: ["src/index.js"],
    bundle: true,
    outfile: "bundle.js",
    plugins: [
      postCssPlugin({
        plugins: [autoprefixer],
      }),
    ],
  })
  .catch((e) => console.error(e.message));

Run:

node build.js

File named bundle.css with appropriate postcss plugins applied.

Readme

Keywords

Package Sidebar

Install

npm i @johnie/esbuild-plugin-postcss

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

6.36 kB

Total Files

11

Last publish

Collaborators

  • johnie