Skip to content

fix: compile css macro platform branches#888

Merged
sonofmagic merged 6 commits into
nextfrom
codex/css-macro-order
Jun 1, 2026
Merged

fix: compile css macro platform branches#888
sonofmagic merged 6 commits into
nextfrom
codex/css-macro-order

Conversation

@sonofmagic
Copy link
Copy Markdown
Owner

变更内容

  • 在 css-macro 展开后按当前平台裁剪可确定的 #ifdef/#ifndef 分支,避免 uni-app 样式条件编译已经结束后错误平台样式仍留在最终产物中。
  • Tailwind CSS v3/v4 小程序生成链路都会在最终样式输出前执行该裁剪。
  • 更新 uni-app v3 generator e2e,锁定 mp-weixin/H5 最终产物不保留错误分支。

验证

  • pnpm --filter weapp-tailwindcss exec vitest run test/css-macro/index.test.ts --coverage.enabled=false
  • pnpm vitest run -c ./e2e/vitest.e2e.config.ts e2e/uni-app-vite-tailwindcss-v3-generator.test.ts --coverage.enabled=false
  • env UNI_BUILD_STRICT=1 pnpm --dir demo/uni-app-vite-tailwindcss-v3 run build:mp-weixin,确认 app.wxss 保留 MP-WEIXIN 蓝色分支且不含 ifndef-[MP-WEIXIN] 红色分支。

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 1, 2026

🦋 Changeset detected

Latest commit: 0efe431

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
weapp-tailwindcss Patch
@weapp-tailwindcss/build-all Patch
@weapp-tailwindcss/website Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sonofmagic sonofmagic merged commit 1da6bd0 into next Jun 1, 2026
20 of 21 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant