Skip to content

Instantly share code, notes, and snippets.

@shanerobinson
Last active March 31, 2020 21:12
Show Gist options
  • Save shanerobinson/71163e0997571eb336ccd7aab8d74fc5 to your computer and use it in GitHub Desktop.
Save shanerobinson/71163e0997571eb336ccd7aab8d74fc5 to your computer and use it in GitHub Desktop.
PostCSS Config file for Svelte Sapper site using Tailwind and Markdown files
const tailwindcss = require("tailwindcss");
const cssnano = require('cssnano');
const purgecss = require("@fullhuman/postcss-purgecss")({
content: ["./src/**/*.svelte", "./src/**/*.html", "./src/**/*.md"],
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || []
});
module.exports = {
plugins: [
tailwindcss("./tailwind.js"),
require('cssnano')({
preset: 'default',
}),
...(process.env.NODE_ENV === "production" ? [purgecss] : []),
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment