Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
a6dc0e16
Commit
a6dc0e16
authored
Dec 11, 2019
by
Joe Haddad
Committed by
JJ Kasper
Dec 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust `postcss-modules` Message (#9703)
parent
a968b380
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
15 deletions
+2
-15
plugins.ts
packages/next/build/webpack/config/blocks/css/plugins.ts
+1
-15
index.test.js
test/integration/css/test/index.test.js
+1
-0
No files found.
packages/next/build/webpack/config/blocks/css/plugins.ts
View file @
a6dc0e16
...
@@ -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
})
}
}
...
...
test/integration/css/test/index.test.js
View file @
a6dc0e16
...
@@ -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
)}
`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment