From d3053693305fb2c663d45d820c4fca0472ab3f33 Mon Sep 17 00:00:00 2001 From: xiekw2010 Date: Fri, 5 Jan 2024 21:18:16 +0800 Subject: [PATCH 1/2] fix: when using tailwind compatible with less, it needs config postcss --- packages/preset-umi/src/commands/generators/tailwindcss.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/preset-umi/src/commands/generators/tailwindcss.ts b/packages/preset-umi/src/commands/generators/tailwindcss.ts index 943cb62fe270..7d38ac0f4843 100644 --- a/packages/preset-umi/src/commands/generators/tailwindcss.ts +++ b/packages/preset-umi/src/commands/generators/tailwindcss.ts @@ -29,6 +29,7 @@ export default (api: IApi) => { }); h.setUmirc('tailwindcss', {}); + h.setUmirc('extraPostCSSPlugins', ['tailwindcss']); h.appendInternalPlugin('@umijs/plugins/dist/tailwindcss'); logger.info('Update .umirc.ts'); From fc5470bb8c63b971bbbbb2d7f5a09384c85d55ce Mon Sep 17 00:00:00 2001 From: xiekw2010 Date: Fri, 5 Jan 2024 22:11:00 +0800 Subject: [PATCH 2/2] feat: adopt existed post css plugin --- packages/preset-umi/src/commands/generators/tailwindcss.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/preset-umi/src/commands/generators/tailwindcss.ts b/packages/preset-umi/src/commands/generators/tailwindcss.ts index 7d38ac0f4843..d15d4501de90 100644 --- a/packages/preset-umi/src/commands/generators/tailwindcss.ts +++ b/packages/preset-umi/src/commands/generators/tailwindcss.ts @@ -29,7 +29,8 @@ export default (api: IApi) => { }); h.setUmirc('tailwindcss', {}); - h.setUmirc('extraPostCSSPlugins', ['tailwindcss']); + const existingPlugins = api.config?.extraPostCSSPlugins || []; + h.setUmirc('extraPostCSSPlugins', ['tailwindcss', ...existingPlugins]); h.appendInternalPlugin('@umijs/plugins/dist/tailwindcss'); logger.info('Update .umirc.ts');