docspell/modules/webapp/postcss.config.js

32 lines
896 B
JavaScript
Raw Normal View History

2021-01-29 19:44:36 +00:00
//postcss.config.js
const tailwindcss = require("tailwindcss");
const devPlugins =
[
require('postcss-import'),
tailwindcss("./tailwind.config.js"),
require("autoprefixer")
];
const prodPlugins =
[
require('postcss-import'),
tailwindcss("./tailwind.config.js"),
require("autoprefixer"),
require("@fullhuman/postcss-purgecss")({
content: [
"./src/main/elm/**/*.elm",
"./src/main/styles/keep.txt",
"../restserver/src/main/templates/*.html"
2021-01-29 19:44:36 +00:00
],
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/\.]+/g) || []
}),
require('cssnano')({
preset: 'default'
})
]
module.exports = (ctx) => ({
plugins: ctx.env === 'production' ? prodPlugins : devPlugins
});