perf(vite): avoid redundant postcss plugins overwrite (#29619)

This commit is contained in:
Michael Brevard 2024-10-21 12:35:36 +03:00 committed by GitHub
parent 49242b2500
commit 585938fcf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,13 +9,12 @@ function sortPlugins ({ plugins, order }: NuxtOptions['postcss']): string[] {
} }
export async function resolveCSSOptions (nuxt: Nuxt): Promise<ViteConfig['css']> { export async function resolveCSSOptions (nuxt: Nuxt): Promise<ViteConfig['css']> {
const css: ViteConfig['css'] & { postcss: NonNullable<Exclude<NonNullable<ViteConfig['css']>['postcss'], string>> } = { const css: ViteConfig['css'] & { postcss: NonNullable<Exclude<NonNullable<ViteConfig['css']>['postcss'], string>> & { plugins: Plugin[] } } = {
postcss: { postcss: {
plugins: [], plugins: [],
}, },
} }
css.postcss.plugins = []
const postcssOptions = nuxt.options.postcss const postcssOptions = nuxt.options.postcss
const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias }) const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias })