Skip to content

Commit

Permalink
Replace postcss-csso with postcss-minify
Browse files Browse the repository at this point in the history
  • Loading branch information
brookback committed Oct 2, 2024
1 parent aa8be7f commit 4e90d25
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 80 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/postcss-extract-media-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const fs = require('fs');
const path = require('path');
const postcss = require('postcss');
const minify = require('postcss-csso');
const minify = require('@csstools/postcss-minify');

const toKebabCase = (str) => str.toLowerCase().replace(/\s+/g, '-');

Expand Down
2 changes: 1 addition & 1 deletion lib/postcss-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ exports.defaultPlugins = ({
...(bundle
? [
require('@fullhuman/postcss-purgecss')(purgeCssOpts),
require('postcss-csso'),
require('@csstools/postcss-minify'),
]
: []),
];
Expand Down
131 changes: 56 additions & 75 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"postcss": "^8"
},
"dependencies": {
"@csstools/postcss-minify": "^2",
"@fullhuman/postcss-purgecss": "^6",
"autoprefixer": "^10",
"postcss-color-function": "^4",
"postcss-csso": "lookback/postcss-csso#fix/csso-container-queries",
"postcss-import": "^16",
"postcss-nested": "^6",
"tailwindcss": "=2.0.2"
Expand Down
4 changes: 2 additions & 2 deletions postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { defaultPlugins } = require('./lib/postcss-plugins');
const path = require('path');
const extractMediaQuery = require('./lib/plugins/postcss-extract-media-query');
const header = require('./lib/plugins/postcss-header');
const csso = require('postcss-csso');
const minify = require('@csstools/postcss-minify');

const extractDarkModeQueries = (dest, prod = false) =>
extractMediaQuery({
Expand Down Expand Up @@ -32,6 +32,6 @@ module.exports = (ctx) => ({
header({
header: `/*! ${ctx.file.basename} v${version} ${new Date().toISOString()} */`,
}),
...(ctx.env === 'production' ? [csso] : []),
...(ctx.env === 'production' ? [minify] : []),
],
});

0 comments on commit 4e90d25

Please sign in to comment.