What problem does it solve?
Upgrading Mpx changes the semantics of conditional compilation: mode now only filters targets while srcMode controls source dialect. Existing projects relying on the old implicit source-dialect behavior (.ali.* files, mode="ali" SFC blocks, @ali attributes, modeRules config) may silently break, and manually finding every affected location is error-prone.
Core Features & Use Cases
- Deterministic project scanning: Runs
scripts/scan-project.js to produce a high-recall candidate set covering conditional files, SFC blocks, @mode attributes, modeRules/srcModeRules conflicts, and <import>/<include> template references.
- Rule-based verification: Uses
references/migration-rules.md and scripts/resolve-platform.js to check each candidate against the actually installed @mpxjs/webpack-plugin platform rules, classifying findings as must-fix, needs-confirmation, compatible-cleanup, or no-change.
- Minimal migration guidance: Recommends the smallest fix per case (rewrite to project srcMode syntax, add
src-mode attributes, or apply precise srcModeRules coverage) and outputs a structured audit report with file and line references.
- Use Case: After upgrading a project from Mpx 2.11 that targets WeChat, Alipay, and React Native, run the audit to find every
.ali.mpx file, mode="ali" block, and @ali attribute that depends on old semantics, then receive a report distinguishing real breakage from safe pass-throughs.
Quick Start
Ask the assistant to audit your Mpx project for mode/srcMode migration issues after the upgrade and produce a report without modifying any code.