React
Example
Created with create-react-app
Method 1 - Use craco
craconpm i --save-dev @fullhuman/postcss-purgecss// craco.config.js
const purgecss = require('@fullhuman/postcss-purgecss');
module.exports = {
style: {
postcss: {
plugins: [
purgecss({
content: ['./src/**/*.html', './src/**/*.tsx', './src/**/*.ts'],
}),
],
},
},
};Method 2 - Run PurgeCSS CLI in postbuild
postbuildMethod 3 - eject create-react-app
eject create-react-appResults
Last updated