Purging unused CSS with Polaris + Next.js #7468
Unanswered
paulgrieselhuber
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Since the import for Polaris is done at the app.js/.tsx level for a Next.js project, this means pulling in the entirety of the Polaris framework's CSS, regardless of how much you use.
I have tested using the basic setup of PurgeCSS suggested in their documentation for a Next.js project, but the purging is too aggressive and breaks the layout. However, the payload for the application shrinks by 400kb in a production build. So, would I would like to be able to achieve a reasonable degree of optimization.
Has anyone had success in accomplishing this with a Polaris + Next.js project?
Beta Was this translation helpful? Give feedback.
All reactions