Registry / http-networking / broccoli-postcss

broccoli-postcss

JSON →
library6.1.0jsnpmunverified

Broccoli plugin to compile CSS through PostCSS plugins. Current stable version is 6.1.0 (PostCSS 8), compatible with Node >=10. Release cadence is low; last update was 2020. Key differentiators: integrates PostCSS into the Broccoli build pipeline, supports whitelist/blacklist filtering via globs, source map configuration, and two plugin definition styles (object and function forms). Alternative to using PostCSS CLI or other build tool integrations.

npm install broccoli-postcss
INSTALL
IMPORT
SIG · BROCCOLI-POSTCSS
B
broccoli-postcss
http-networkingjavascriptv6.1.0
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.

default
const compileCSS = require('broccoli-postcss')
import compileCSS from 'broccoli-postcss'
Library does not support ES modules; CommonJS only.
default
const compileCSS = require('broccoli-postcss')
const { compileCSS } = require('broccoli-postcss')
Default export is a function, not a named export.
default (TypeScript)
const compileCSS: any = require('broccoli-postcss')
import compileCSS from 'broccoli-postcss'
No type definitions available; use any or write own types.

Configures broccoli-postcss with one plugin (postcss-cssnext), sets source maps off, includes styles/*.css, excludes vendor/**/*.

const compileCSS = require('broccoli-postcss'); const cssnext = require('postcss-cssnext'); const options = { plugins: [ { module: cssnext, options: { browsers: ['last 2 versions'] } } ], map: false, include: ['styles/*.css'], exclude: ['vendor/**/*'] }; const outputTree = compileCSS('app/styles', options); module.exports = outputTree;
Debug
Known issues
breakingVersion 6 requires PostCSS 8. PostCSS 8 uses a new plugin API; some plugins may not be compatible.
fix
Update all postcss plugins to versions supporting PostCSS 8, or stay on v5 with PostCSS 7.
affects: >=6.0.0
breakingNode.js >=10 required as of version 6.
fix
Upgrade Node.js to version 10 or higher.
affects: >=6.0.0
deprecatedThe 'browsers' option is deprecated; use browserslist configuration (package.json or .browserslistrc) instead.
fix
Remove 'browsers' from options and set up browserslist in your project.
affects: >=5.0.0
gotchaPlugins defined in function form cannot have additional options merged (e.g., map). Use object form for extra options.
fix
Use object form: { module: require('plugin'), options: { ... } }
affects: all
gotchaThe library is CommonJS only; ES module imports (import) will fail.
fix
Use require() instead of import.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'postcss'
postcss is a peer dependency and not installed automatically.
fix
npm install --save-dev postcss
TypeError: options.plugins[0].module is not a constructor
Plugin may be incompatible with PostCSS 8 or not using object form correctly.
fix
Ensure plugins are compatible with PostCSS 8 and use object form: { module: require('plugin'), options: {} }
ReferenceError: require is not defined
Trying to use require() in an ES module context.
fix
Use import or ensure you are using CommonJS (type: 'commonjs' in package.json).
Upgrade
Version history
6.1.0latest on npm
Audit
Dependencies
broccoli-persistent-filterrequiredUnderlying filter mechanism for incremental builds
postcssrequiredPeer dependency for PostCSS functionality
Agent activity
16 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources