You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
696 B

  1. const purgecss = require("@fullhuman/postcss-purgecss")({
  2. content: [
  3. "./src/**/*.jsx",
  4. "./src/**/*.tsx",
  5. "./src/**/*.js",
  6. "./src/**/*.ts",
  7. "./public/index.html",
  8. ],
  9. defaultExtractor: (content) => {
  10. const broadMatches = content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || [];
  11. const innerMatches = content.match(/[^<>"'`\s.()]*[^<>"'`\s.():]/g) || [];
  12. return broadMatches.concat(innerMatches);
  13. },
  14. });
  15. module.exports = {
  16. plugins: [
  17. require("postcss-import"),
  18. require("tailwindcss"),
  19. require("autoprefixer"),
  20. ...(process.env.NODE_ENV === "production"
  21. ? [purgecss, require("postcss-discard-comments")({ removeAll: true })]
  22. : []),
  23. ],
  24. };