PostCSS plugin postcss-purgecss requires PostCSS 8.
See original GitHub issueDescribe the bug Config PurgeCSS with Gridsome Vuejs and gets this error
Screenshots
Environment (please complete the following information):
- OS: Windows
- Packages: purgecss, postcss-loader, @fullhuman/postcss-purgecss, @fullhuman/vue-cli-plugin-purgecss
- Version:
"postcss": "^8.2.9",
"postcss-loader": "^5.2.0",
"@fullhuman/postcss-purgecss": "^4.0.3",
"@fullhuman/vue-cli-plugin-purgecss": "~4.0.3",
Additional context Config:
chainWebpack: config => {
config.plugin('css').use(MiniCssExtractPlugin, [{
filename: '[name].[hash].css',
}])
config.module
.rule('css')
.oneOf('normal')
.use('postcss-loader')
.tap(options => {
options.plugins.unshift(...[
require('cssnano'),
purgecss({
content: [`./public/**/*.html`, `./src/**/*.vue`],
defaultExtractor(content) {
const contentWithoutStyleBlocks = content.replace(
/<style[^]+?<\/style>/gi,
""
);
return (
contentWithoutStyleBlocks.match(
/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g
) || []
);
},
safelist: [
/-(leave|enter|appear)(|-(to|from|active))$/,
/^(?!(|.*?:)cursor-move).+-move$/,
/^router-link(|-exact)-active$/,
/data-v-.*/,
],
})
])
return options
})
config.performance.hints('warning')
},
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Error: PostCSS plugin tailwindcss requires PostCSS 8
I tried to uninstall postcss and tailwindcss but it does not work. Need help. Module build failed (from ./node_modules/postcss-loader/src/index.
Read more >Error: PostCSS plugin postcss-purgecss requires PostCSS 8.
Error: PostCSS plugin postcss-purgecss requires PostCSS 8. solution: unintsall tailwind and install again. npm uninstall tailwindcss postcss autoprefixer.
Read more >React with Tailwind CSS - Product Engineering
Error: PostCSS plugin tailwindcss requires PostCSS 8. You can also use Tailwind CSS that supports the previous version. npm install -D tailwindcss@npm:@ ...
Read more >“gulp PostCSS plugin tailwindcss requires PostCSS 8.” Code ...
npm uninstall tailwindcss postcss autoprefixer npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9.
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 had the same issue and nothing worked until i downgraded.
npm i -D @fullhuman/postcss-purgecss@3.0.0 postcss@7.0.35
PurgeCSS version >4 will work with PostCSS 8. You will need to use version 3.0.0 with PostCSS 7