Skip to content

Commit 415faf7

Browse files
committed
fix(vite): avoid dts type recursion in postcss plugin replacement
1 parent 34d9351 commit 415faf7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • packages/weapp-tailwindcss/src/bundlers/vite

packages/weapp-tailwindcss/src/bundlers/vite/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,12 @@ export function UnifiedViteWeappTailwindcssPlugin(options: UserDefinedOptions =
184184
await refreshRuntimeState(true)
185185
}
186186
if (typeof config.css.postcss === 'object' && Array.isArray(config.css.postcss.plugins)) {
187-
const idx = config.css.postcss.plugins.findIndex(x =>
187+
const postcssPlugins = config.css.postcss.plugins as unknown[]
188+
const idx = postcssPlugins.findIndex(x =>
188189
// @ts-ignore
189190
x.postcssPlugin === 'postcss-html-transform')
190191
if (idx > -1) {
191-
config.css.postcss.plugins.splice(idx, 1, postcssHtmlTransform())
192+
postcssPlugins.splice(idx, 1, postcssHtmlTransform())
192193
debug('remove postcss-html-transform plugin from vite config')
193194
}
194195
}

0 commit comments

Comments
 (0)