/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/postcss-function.mdx
33 строки
684 B
Delba de Oliveira
docs: Migrate error messages to MDX and App Router. (#52038)
05 июл 2023, 16:11
Не верифицирован
05 июл 2023, 16:11
44d1a1c
Код
Авторство
О чём код?
--- title: PostCSS Configuration Is a Function --- ## Why This Error Occurred The project's custom PostCSS configuration exports a function instead of an object. ## Possible Ways to Fix It Adjust the custom PostCSS configuration to not export a function. Instead, return a plain object. If you need environment information, read it from `process.env`. **Before** ```js filename="postcss.config.js" module.exports = ({ env }) => ({ plugins: { 'postcss-plugin': env === 'production' ? {} : false, }, }) ``` **After** ```js filename="postcss.config.js" module.exports = { plugins: { 'postcss-plugin': process.env.NODE_ENV === 'production' ? {} : false, }, } ```