-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated PurgeCSS to eradicate unused CSS. Shrinks the size of CSS output considerably.
- Loading branch information
Gary McLean Hall
committed
Apr 5, 2020
1 parent
97d72b0
commit a48d607
Showing
4 changed files
with
119 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
// postcss.config.js | ||
const purgecss = require('@fullhuman/postcss-purgecss')({ | ||
|
||
// Specify the paths to all of the template files in your project | ||
content: [ | ||
'./src/**/*.html', | ||
'./src/**/*.vue', | ||
'./src/**/*.js(x)', | ||
// etc. | ||
], | ||
|
||
// Include any special characters you're using in this regular expression | ||
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [] | ||
}) | ||
|
||
module.exports = { | ||
plugins: { | ||
tailwindcss: './tailwind.config.js', | ||
autoprefixer: {} | ||
} | ||
} | ||
plugins: [ | ||
require('tailwindcss'), | ||
require('autoprefixer'), | ||
...process.env.NODE_ENV === 'production' | ||
? [purgecss] | ||
: [] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters