Skip to content

Styles don't load in production, works in dev. Using Next.js with MDX #2714

Discussion options

You must be logged in to vote

I removed the entire thing below from postcss.config.js & now it works fine:

process.env.NODE_ENV === 'production'
			? [
					'@fullhuman/postcss-purgecss',
					{
						content: ['./pages/**/*.{js,jsx,ts,tsx}', './components/**/*.{js,jsx,ts,tsx}'],
						defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
					},
			  ]
			: undefined,

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@simonswiss
Comment options

@deadcoder0904
Comment options

Answer selected by deadcoder0904
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants