lucleray / next-purgecss

nextjs + purgecss for smaller css bundles
https://www.npmjs.com/package/next-purgecss
134 stars 8 forks source link

Built-in CSS Support? #45

Closed mattrothenberg closed 4 years ago

mattrothenberg commented 4 years ago

Hello! Now that Next has built-in CSS support, I'm curious if it's totally necessary to use @zeit/next-css in conjunction with this plugin? Note that running next build with that plugin specified leads to a warning.

$ next build
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
See here for more info: https://err.sh/next.js/built-in-css-disabled
lucleray commented 4 years ago

If you're using Next.js built-in CSS support, you can use the @fullhuman/postcss-purgecss PostCSS plugin to remove unused CSS.

Here's an example with tailwindcss: https://github.com/zeit/next.js/blob/master/examples/with-tailwindcss/postcss.config.js.

onukselcuk commented 4 years ago

@lucleray could you please put this in the readme document. So people wouldn't need to try to find an answer to this in the closed isssues like I'm doing at the moment. I believe you could also refactor the package due to the next.js' built-in css support.