Use Taliwind's purge option

This commit is contained in:
Taylor Bryant 2020-05-01 19:09:13 -05:00
parent 347d5fdbcf
commit 370b236de2
4 changed files with 15 additions and 26 deletions

View File

@ -1,12 +1,12 @@
<!doctype html>
<!DOCTYPE html>
<html class="no-js" lang="en-US">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Tailwind Jekyll Starter Kit</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/style.css" />
</head>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Tailwind Jekyll Starter Kit</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/style.css">
</head>
<body>
<body></body>
</html>

View File

@ -1,4 +1,3 @@
import purgecss from "@fullhuman/postcss-purgecss";
import autoprefixer from "autoprefixer";
import browserSync from "browser-sync";
import spawn from "cross-spawn";
@ -38,17 +37,7 @@ task("processStyles", () => {
postcss([
atimport(),
tailwindcss(TAILWIND_CONFIG),
...(!isDevelopmentBuild
? [
purgecss({
content: [`${SITE_ROOT}/**/*.html`],
defaultExtractor: (content) =>
content.match(/[\w-/:]+(?<!:)/g) || [],
}),
autoprefixer(),
cssnano(),
]
: []),
...(isDevelopmentBuild ? [] : [autoprefixer(), cssnano()]),
])
)
.pipe(dest(POST_BUILD_STYLESHEET));

View File

@ -4,7 +4,6 @@
"description": "A starter kit for using Tailwind with Jekyll",
"main": "gulpfile.babel.js",
"devDependencies": {
"@fullhuman/postcss-purgecss": "2.1.2",
"autoprefixer": "9.7.6",
"babel-preset-env": "1.7.0",
"babel-register": "6.26.0",

View File

@ -1,7 +1,8 @@
module.exports = {
purge: [`_site/**/*.html`],
theme: {
extend: {}
extend: {},
},
variants: {},
plugins: []
}
plugins: [],
};