Skip to content

Commit

Permalink
Add PurgeCSS
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdyer committed May 3, 2022
1 parent 2c13ca4 commit fc3f9be
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 8 deletions.
64 changes: 64 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "starter-graffapp",
"name": "graffapp-starter",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Head from 'next/head'

export default function Home() {
return (
<h1 className="text-3xl font-bold underline">
Hello world!
<h1 className="text-3xl font-bold font-mono text-orange-700 underline">
hello, world!
</h1>
)
}
25 changes: 20 additions & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
plugins: [
'tailwindcss',
'autoprefixer',
[
"@fullhuman/postcss-purgecss",
process.env.NODE_ENV === "production"
? {
// the paths to all template files
content: [
"./pages/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
],
// function used to extract class names from the templates
defaultExtractor: (content) =>
content.match(/[\w-/:]+(?<!:)/g) || [],
}
: false,
],
],
};

0 comments on commit fc3f9be

Please sign in to comment.