Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: accept AcceptedPlugin type for postcss plugin #8830

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/config/shared-options.md
Expand Up @@ -198,7 +198,7 @@ Configure CSS modules behavior. The options are passed on to [postcss-modules](h

## css.postcss

- **Type:** `string | (postcss.ProcessOptions & { plugins?: postcss.Plugin[] })`
- **Type:** `string | (postcss.ProcessOptions & { plugins?: postcss.AcceptedPlugin[] })`

Inline PostCSS config or a custom directory to search PostCSS config from (default is project root).

Expand Down
6 changes: 3 additions & 3 deletions packages/vite/src/node/plugins/css.ts
Expand Up @@ -70,7 +70,7 @@ export interface CSSOptions {
postcss?:
| string
| (PostCSS.ProcessOptions & {
plugins?: PostCSS.Plugin[]
plugins?: PostCSS.AcceptedPlugin[]
})
/**
* Enables css sourcemaps during dev
Expand Down Expand Up @@ -833,7 +833,7 @@ async function compileCSS(
UrlRewritePostcssPlugin({
replacer: urlReplacer,
logger: config.logger
}) as PostCSS.Plugin
})
)

if (isModule) {
Expand Down Expand Up @@ -1009,7 +1009,7 @@ async function finalizeCss(

interface PostCSSConfigResult {
options: PostCSS.ProcessOptions
plugins: PostCSS.Plugin[]
plugins: PostCSS.AcceptedPlugin[]
}

async function resolvePostcssConfig(
Expand Down