rollup-plugin-postcss-config

2.0.0 • Public • Published

rollup-plugin-postcss-config

Build Status npm semantic-release

Transform PostCSS in Rollup using options from a config file.

Install

npm install -D rollup-plugin-postcss-config

Usage

Configuration

Define PostCSS transform options, like plugins, in postcss.config.js.

module.exports = {
  plugins: {
    'postcss-import': {},
    'postcss-cssnext': {},
    'postcss-reporter': {},
  },
};

See postcss-load-config for more options.

Rollup

This plugin makes no assumptions about what to do with the transformed CSS. Another plugin has to follow to consume its output.

In the following example rollup.config.js, the transformed CSS is converted to a string using rollup-plugin-string:

import postcss from 'rollup-plugin-postcss-config';
import string from 'rollup-plugin-string';
 
export default {
  plugins: [
    postcss({
      // Default value, can be omitted.
      include: '*.css', 
      // Undefined by default.
      exclude: 'node_modules/**',
    }),
    string({
      include: '*.css',
      exclude: 'node_modules/**',
    }),
  ],
};
 

Package Sidebar

Install

npm i rollup-plugin-postcss-config

Weekly Downloads

92

Version

2.0.0

License

MIT

Unpacked Size

81.5 kB

Total Files

6

Last publish

Collaborators

  • updater-admin