diff --git a/packages/vant-cli/cjs/postcss.config.cjs b/packages/vant-cli/cjs/postcss.config.cjs index 4f108dfa0..4e6f16b9d 100644 --- a/packages/vant-cli/cjs/postcss.config.cjs +++ b/packages/vant-cli/cjs/postcss.config.cjs @@ -14,11 +14,15 @@ function getPostcssPlugins(rootConfig) { const plugins = rootConfig.plugins || []; if (Array.isArray(plugins)) { - const hasPostcssPlugin = plugins.find( - (plugin) => - plugin === 'autoprefixer' && plugin.postcssPlugin === 'autoprefixer' + const hasAutoprefixerPlugin = plugins.find( + (plugin) => { + if (typeof plugin === 'object') { + return plugin.postcssPlugin === 'autoprefixer'; + } + return plugin === 'autoprefixer'; + } ); - if (hasPostcssPlugin) { + if (hasAutoprefixerPlugin) { return plugins; }