build time with postcss-purgecss is ~4x slower on v2.1.0 compared to 1.4.2
See original GitHub issueI just ran a few tests and here are the results I’m getting:
Build time without postcss-purgecss: 76.02s
Build time with “@fullhuman/postcss-purgecss”: “^1.4.2”, 111.81s
Build time with “@fullhuman/postcss-purgecss”: “^2.1.0”, 385.60s
Here is the contents of my postcss.config.js
module.exports = {
plugins: [
process.env.NODE_ENV === 'production' ? require('@fullhuman/postcss-purgecss')({
content: [
'./public/**/*.html',
'./src/**/*.vue',
// custom
'./node_modules/vue-multiselect/src/Multiselect.vue',
// './node_modules/vue-tables-2/**/*',
'./node_modules/bootstrap-vue/src/components/**/*.js',
],
defaultExtractor: (content) => {
const contentWithoutStyleBlocks = content.replace(/<style[^]+?<\/style>/gi, '');
return contentWithoutStyleBlocks.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || [];
},
whitelistPatterns: [
/-(leave|enter|appear)(|-(to|from|active))$/,
/^(?!cursor-move).+-move$/,
/^router-link(|-exact)-active$/,
// custom
/^multiselect/,
],
}) : '',
],
};
Any idea why this is happening and if there’s a way to get reasonable build times using the latest version?
Many thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Poor performance as part of a webpack PostCSS build system
It takes about 10 seconds on my MacBook Pro 2019 just changing a single color in a .pcss file, and it appears externally...
Read more >Remove unused CSS | CssRepo
build time with postcss -purgecss is ~4x slower on v2.1.0 compared to 1.4.2. I just ran a few tests and here are the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i’d also be interested with how it improves here (tested against 1.4.0):
https://github.com/leeoniya/dropcss#performance https://github.com/leeoniya/dropcss/tree/master/test/bench#readme
the source & corpus for the stress bench are in the second link, if interested.
I added a branch here. You will see a package named comparison. It will run PurgeCSS v1 and PurgeCSS v2 and print times in the console. Was thinking of going through the performance investigation too so I’ll definitely be open to review a PR about it. Thanks!