JSPM

gatsby-plugin-postcss

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 62252
  • Score
    100M100P100Q160137F
  • License MIT

Gatsby plugin to handle PostCSS

Package Exports

  • gatsby-plugin-postcss

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gatsby-plugin-postcss) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

NPM version Travis build status AppVeyor build status Maintainability Test Coverage Dependency Status Development Dependency Status

gatsby-plugin-postcss

Gatsby plugin to handle PostCSS.

Install

yarn add gatsby-plugin-postcss

or

npm install --save gatsby-plugin-postcss

How to Use

gatsby-config.js

module.exports = {
  plugins: ['gatsby-plugin-postcss']
};

This plugin uses postcss-loader with its default options that means you can use your own postcss.config.js:

postcss.config.js

const postcssPresetEnv = require('postcss-preset-env');

module.exports = () => ({
  plugins: [
    postcssPresetEnv({
      stage: 0
    })
  ]
});

Options

You can use any allowed postcss-loader options using postcss property:

gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-plugin-postcss',
      options: {
        postcss: {
          plugins: () => [require('postcss-preset-env')({ stage: 0 })]
        }
      }
    }
  ]
};