Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit 5ad72e6

Browse files
authored
Merge pull request #25 from taphill/yarn_upgrades
Update postcss config
2 parents 64e0b53 + 1788df2 commit 5ad72e6

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

app/javascript/stylesheets/tailwind.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
module.exports = {
2-
purge: [
3-
'.app/**/*.html.erb',
4-
'.app/helper/*.rb',
5-
],
2+
purge: [],
63
darkMode: false, // or 'media' or 'class'
74
theme: {
85
extend: {},

postcss.config.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
1-
module.exports = {
1+
let environment = {
22
plugins: [
33
require('tailwindcss')("./app/javascript/stylesheets/tailwind.config.js"),
4+
require('autoprefixer'),
45
require('postcss-import'),
56
require('postcss-flexbugs-fixes'),
67
require('postcss-preset-env')({
78
autoprefixer: {
89
flexbox: 'no-2009'
910
},
1011
stage: 3
11-
})
12+
}),
1213
]
1314
}
15+
16+
if (process.env.RAILS_ENV === "production") {
17+
environment.plugins.push(
18+
require('@fullhuman/postcss-purgecss')({
19+
content: ['./app/**/*.html.erb', '.app/helper/*.rb'],
20+
safelist: {
21+
greedy: [/input|prose$/],
22+
},
23+
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || []
24+
})
25+
)
26+
}
27+
28+
module.exports = environment

0 commit comments

Comments
 (0)