Unverified Commit fe4b7113 authored by Sukka's avatar Sukka Committed by GitHub

fix: correct the next config optimizeCss type (#38879)

`experimental.optimizeCss` from `next.config.js` can be an object containing the critters' option:

https://github.com/vercel/next.js/blob/70a53e0789c7e361f12139db6e124a5bb1d2afd9/packages/next/server/post-process.ts#L224-L232

The PR corrects the ajv schema and the type definition of `experimental.optimizeCss`.
parent 552620f9
...@@ -333,7 +333,14 @@ const configSchema = { ...@@ -333,7 +333,14 @@ const configSchema = {
type: 'boolean', type: 'boolean',
}, },
optimizeCss: { optimizeCss: {
type: 'boolean', oneOf: [
{
type: 'boolean',
},
{
type: 'object',
},
] as any,
}, },
outputFileTracingRoot: { outputFileTracingRoot: {
minLength: 1, minLength: 1,
......
...@@ -94,7 +94,10 @@ export interface ExperimentalConfig { ...@@ -94,7 +94,10 @@ export interface ExperimentalConfig {
isrFlushToDisk?: boolean isrFlushToDisk?: boolean
workerThreads?: boolean workerThreads?: boolean
pageEnv?: boolean pageEnv?: boolean
optimizeCss?: boolean // optimizeCss can be boolean or critters' option object
// Use Record<string, unknown> as critters doesn't export its Option type
// https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters/src/index.d.ts
optimizeCss?: boolean | Record<string, unknown>
nextScriptWorkers?: boolean nextScriptWorkers?: boolean
scrollRestoration?: boolean scrollRestoration?: boolean
externalDir?: boolean externalDir?: boolean
......
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