You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Environment variable, defaults toprocess.env.NODE_ENV where available
exclude
Files to exclude
failOnError
Allows errors to propagate whentrue, otherwise warnings are thrown
from
Input file name (usually set by rollup)
include
Files to include
plugins
Array of PostCSS plugins, defaults topostcss.config.js
styleDelimiter
Custom delimiter for parsing styles in a file, default is /`/
styleRegex
Custom regex for selecting CSS in file
to
Output file name (usually set by rollup)
Template Literals in JavaScript
This plugin by default looks for a template literal in JavaScript (or TypeScript) and will process CSS found inside of the string. This is particularly useful for Web Components or other CSS in JavaScript situations. The default pattern is below. The regex can be configured by passing the styleRegex property in the plugin options.
This plugin honorspostcss.config.js in the root directory and will look for environment variables based on the currentNODE_ENV. The example postcss.config.js below demonstrates minifying CSS with thepostcss-csso plugin only when the NODE_ENV is set toprod.