Skip to content

Commit 6886078

Browse files
authored
feat: accept AcceptedPlugin type for postcss plugin (#8830)
1 parent 0b00f49 commit 6886078

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/config/shared-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Configure CSS modules behavior. The options are passed on to [postcss-modules](h
198198

199199
## css.postcss
200200

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

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

packages/vite/src/node/plugins/css.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export interface CSSOptions {
7070
postcss?:
7171
| string
7272
| (PostCSS.ProcessOptions & {
73-
plugins?: PostCSS.Plugin[]
73+
plugins?: PostCSS.AcceptedPlugin[]
7474
})
7575
/**
7676
* Enables css sourcemaps during dev
@@ -833,7 +833,7 @@ async function compileCSS(
833833
UrlRewritePostcssPlugin({
834834
replacer: urlReplacer,
835835
logger: config.logger
836-
}) as PostCSS.Plugin
836+
})
837837
)
838838

839839
if (isModule) {
@@ -1009,7 +1009,7 @@ async function finalizeCss(
10091009

10101010
interface PostCSSConfigResult {
10111011
options: PostCSS.ProcessOptions
1012-
plugins: PostCSS.Plugin[]
1012+
plugins: PostCSS.AcceptedPlugin[]
10131013
}
10141014

10151015
async function resolvePostcssConfig(

0 commit comments

Comments
 (0)