JSPM

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

Package Exports

  • @snowpack/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 (@snowpack/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

@snowpack/plugin-postcss

Run PostCSS on all .css files, including ones generated from Sass, Vue, and Svelte.

Usage

From a terminal, run the following:

npm install --save-dev @snowpack/plugin-postcss postcss postcss-cli

Then add this plugin to your Snowpack config:

// snowpack.config.json
{
  "plugins": [
    "@snowpack/plugin-postcss"
  ]
}

Lastly, add a postcss.config.js file to the root of your project as you would normally:

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

module.exports = {
  plugins: [cssnano(), postcssPresetEnv()],
};

Plugin Options

Name Type Description
input string[] File extensions to transform (default: ['.css'])
config string (optional) Set a custom path to your PostCSS config (in case PostCSS has trouble loading it automatically, or in case you want multiple PostCSS setups)