Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
feat(reason): add postcss-purgecss fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
believer committed Sep 6, 2019
1 parent f077b38 commit 4d9d50e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/templates/reason/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"reason-react": "0.7.0"
},
"devDependencies": {
"@fullhuman/postcss-purgecss": "1.2.0",
"@glennsl/bs-jest": "0.4.9",
"@semantic-release/changelog": "3.0.4",
"@semantic-release/git": "7.0.16",
Expand Down
12 changes: 11 additions & 1 deletion src/templates/reason/postcss.config.js.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
const purgecss = require("@fullhuman/postcss-purgecss")({
content: ["./lib/**/*.js"],
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || []
});

module.exports = {
plugins: [require("tailwindcss"), require("autoprefixer")]
plugins: [
require("tailwindcss"),
require("autoprefixer"),
...(process.env.NODE_ENV === "production" ? [purgecss] : [])
]
};


0 comments on commit 4d9d50e

Please sign in to comment.