Migrate legacy projects from responsibility boundaries and the build graph; do not layer patches on top of the old configuration.
Workflow
- Read the manifest, lockfile, Tailwind entry, bundler configuration, PostCSS configuration, and run scripts.
- Identify the current weapp-tailwindcss/Tailwind/Node/HBuilderX/bundler versions and all generation entries.
- Read references/v5-migration.md, and migrate in the order of dependencies, entries, plugins, target platforms, and verification.
- Delete the old patch and duplicate Tailwind generators in the same build, then register the current
WeappTailwindcss。 - Legacy CLI users migrate to the standalone
@weapp-tailwindcss/cli5.x, and move theinit, preprocessor, and directory scanning responsibilities back into the project build chain. - Migrate the Tailwind entry to pure CSS, ensure it is actually imported, and write all real entries as absolute
cssEntries。 - Remove the old logic of “always disabling H5/Web”; let the generator automatically detect the Web target.
- Verify the migration with one clean build, one newly added arbitrary-value class, and one HMR update; the App target must be checked in a real runtime.
Migration discipline
- First record the old configuration and a rollback commit; do not mass-delete PostCSS or framework plugins whose ownership cannot be confirmed.
- Only delete duplicate entries responsible for Tailwind generation; separate builds of standalone Web apps may continue to use the official Tailwind plugin.
- Do not use
alwaysEscapeor expand string scanning to mask outdatedclassNameSet。 - Do not equate a successful build with a successful migration; at minimum check the target platform CSS, template/JS safe class, and newly added candidates.
Output requirements
Output the pre-migration diagnosis, deletion/retention list, per-file diff, verification results, and rollback steps, and flag any device or IDE environments that still require manual verification.