Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Transform PostCSS in Rollup using options from a config file.

License

Notifications You must be signed in to change notification settings

Updater/rollup-plugin-postcss-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/**',
    }),
  ],
};

About

Transform PostCSS in Rollup using options from a config file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •