bun-postcss-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

bun-postcss-plugin

bun-postcss-plugin is a PostCSS plugin for Bun that enables importing CSS files directly in your JavaScript files. Once imported, the plugin processes the CSS using PostCSS, and returns the processed CSS as a string which can be injected into your document or utilized however you see fit.

Installation

bun install bun-postcss-plugin --save-dev

Getting Started

Add the plugin to your preload in your bunfig.toml

preload = [ "bun-postcss-plugin" ]

and your tsconfig.json types field

{
  "compilerOptions": {
    // ...
    "types": [
        // ...
        "bun-postcss-plugin"
    ]
  }
}

Then you can import css files in your code directly as such

// Import your CSS
import styles from './styles.css';

// Your CSS is now processed and ready to use!
console.log(styles);  // Logs processed CSS as a string

Configuration

bun-postcss-plugin will use the standard postcss.config.js file, like many other projects do.

Package Sidebar

Install

npm i bun-postcss-plugin

Weekly Downloads

4

Version

1.0.1

License

MIT-0

Unpacked Size

4.43 kB

Total Files

7

Last publish

Collaborators

  • nyxkrage