Registry / devops / broccoli-postcss-single

broccoli-postcss-single

JSON →
library5.0.2jsnpmunverified

A Broccoli plugin that compiles CSS using PostCSS, operating on individual files. The current stable version is 5.0.2, which uses PostCSS V8, while version 4 uses PostCSS V7. It requires Node >= 10 and integrates into Broccoli build pipelines. Unlike broader PostCSS plugins for Broccoli, this one focuses on single-file processing, supports both object and function plugin definitions, and includes caching with configurable include/exclude patterns. Maintenance appears minimal.

npm install broccoli-postcss-single
INSTALL
IMPORT
SIG · BROCCOLI-POSTCSS-S
B
broccoli-postcss-single
devopsjavascriptv5.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compileCSS
import compileCSS from 'broccoli-postcss-single'
const compileCSS = require('broccoli-postcss-single');
CommonJS require works in Node but ESM import is preferred for modern code.
compileCSS
const compileCSS = require('broccoli-postcss-single');
const { compileCSS } = require('broccoli-postcss-single');
Default export only, not named.

Shows how to use broccoli-postcss-single with Brocfile, including plugin configuration and source maps.

// Brocfile.js or Brocfile.ts import compileCSS from 'broccoli-postcss-single'; import autoprefixer from 'autoprefixer'; const inputTrees = ['styles']; // path to source directory const inputFile = 'app.css'; const outputFile = 'app.css'; const options = { plugins: [ { module: autoprefixer, options: { overrideBrowserslist: ['> 1%', 'last 2 versions'] } } ], map: { inline: true }, browsers: ['last 2 versions'] }; const outputTree = compileCSS(inputTrees, inputFile, outputFile, options); export default outputTree;
Debug
Known issues
breakingUpgrading from v4 to v5 requires PostCSS V8; some PostCSS plugins may need updates.
fix
Update to v5 and ensure all PostCSS plugins are compatible with V8.
affects: >=4.0.0 <5.0.0
gotchaThe cache only includes .css, .scss, .sass, .less by default. Custom file types (e.g., .vue) require cacheInclude configuration.
fix
Add cacheInclude: [/.*\.(vue|other)/] to options.
affects: >=5.0.0
gotchaIf using Tailwind or a PostCSS plugin with a config file, changes to the config won't trigger rebuilds unless cacheInclude includes JS files.
fix
Set cacheInclude: [/.*\.(css|js|config)/] or similar.
affects: >=5.0.0
deprecatedThe 'browsers' option is typically deprecated in favor of browserslist config in package.json or .browserslistrc.
fix
Use browserslist configuration instead of passing 'browsers' array.
affects: >=4.0.0
Errors
Common errors & fixes
Error: The 'plugins' option requires at least one plugin
Empty plugins array or missing plugins option.
fix
Provide at least one plugin in the plugins array.
Cannot find module 'postcss'
PostCSS is not installed as a peer dependency.
fix
Run 'npm install --save-dev postcss'.
TypeError: compileCSS is not a function
Incorrect import (e.g., named import instead of default).
fix
Use 'import compileCSS from "broccoli-postcss-single"' or 'const compileCSS = require("broccoli-postcss-single")'.
Upgrade
Version history
5.0.2latest on npm
Audit
Dependencies
postcssrequiredCore peer dependency for CSS transformations
broccoli-pluginrequiredBase class for creating Broccoli plugins
Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
broccoli-postcss-single — npm install broccoli-postcss-single · libregistry