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
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 })]
}
}
}
]
};