Commit a6dc0e16 authored by Joe Haddad's avatar Joe Haddad Committed by JJ Kasper

Adjust `postcss-modules` Message (#9703)

parent a968b380
...@@ -66,6 +66,7 @@ export async function getPostCssPlugins(dir: string): Promise<unknown[]> { ...@@ -66,6 +66,7 @@ export async function getPostCssPlugins(dir: string): Promise<unknown[]> {
'postcss-modules-scope', 'postcss-modules-scope',
'postcss-modules-extract-imports', 'postcss-modules-extract-imports',
'postcss-modules-local-by-default', 'postcss-modules-local-by-default',
'postcss-modules',
].forEach(plugin => { ].forEach(plugin => {
if (!plugins.hasOwnProperty(plugin)) { if (!plugins.hasOwnProperty(plugin)) {
return return
...@@ -80,21 +81,6 @@ export async function getPostCssPlugins(dir: string): Promise<unknown[]> { ...@@ -80,21 +81,6 @@ export async function getPostCssPlugins(dir: string): Promise<unknown[]> {
delete plugins[plugin] delete plugins[plugin]
}) })
// Next.js doesn't support CSS Modules yet. When we do, we should respect the
// options passed to this plugin (even though we need to remove the plugin
// itself).
if (plugins['postcss-modules']) {
delete plugins['postcss-modules']
console.warn(
`${chalk.yellow.bold(
'Warning'
)}: Next.js does not support CSS Modules (yet). The ${chalk.underline(
'postcss-modules'
)} plugin will have no effect.`
)
}
target = load(plugins as { [key: string]: object }) target = load(plugins as { [key: string]: object })
} }
......
...@@ -299,6 +299,7 @@ describe('CSS Support', () => { ...@@ -299,6 +299,7 @@ describe('CSS Support', () => {
'postcss-modules-scope', 'postcss-modules-scope',
'postcss-modules-extract-imports', 'postcss-modules-extract-imports',
'postcss-modules-local-by-default', 'postcss-modules-local-by-default',
'postcss-modules',
].forEach(plugin => { ].forEach(plugin => {
expect(stderr).toMatch( expect(stderr).toMatch(
new RegExp(`Please remove the.*?${escapeStringRegexp(plugin)}`) new RegExp(`Please remove the.*?${escapeStringRegexp(plugin)}`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment