Skip to content

Commit

Permalink
Explain Ignored PostCSS Plugin (#10240)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer authored Jan 23, 2020
1 parent a356d2f commit c713741
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions errors/postcss-ignored-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Ignored PostCSS Plugin

#### Why This Error Occurred

The project's custom PostCSS configuration attempts to configure unnecessary plugins:

- postcss-modules-values
- postcss-modules-scope
- postcss-modules-extract-imports
- postcss-modules-local-by-default
- postcss-modules

#### Possible Ways to Fix It

Remove the plugin specified in the error message from your custom PostCSS configuration.

#### How do I configure CSS Modules?

CSS Modules are supported in [Next.js' built-in CSS support](https://nextjs.org/docs/advanced-features/customizing-postcss-config).
You can [read more](https://nextjs.org/docs/advanced-features/customizing-postcss-config) about how to use them [here](https://nextjs.org/docs/advanced-features/customizing-postcss-config).
3 changes: 2 additions & 1 deletion packages/next/build/webpack/config/blocks/css/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function isIgnoredPlugin(pluginPath: string): boolean {
`${chalk.yellow.bold('Warning')}: Please remove the ${chalk.underline(
plugin
)} plugin from your PostCSS configuration. ` +
`This plugin is automatically configured by Next.js.`
`This plugin is automatically configured by Next.js.\n` +
'Read more: https://err.sh/next.js/postcss-ignored-plugin'
)
return true
}
Expand Down

0 comments on commit c713741

Please sign in to comment.