Skip to content

Commit def3eb0

Browse files
committed
fix(migrate): override vite-plus version for standalone projects in force-migrate mode
In `rewriteStandaloneProject`, when `VITE_PLUS_FORCE_MIGRATE=1`: - The pnpm overrides didn't include `vite-plus` itself (only vite, vitest, etc.) - The devDependency wasn't updated if `vite-plus` already existed This caused ecosystem-ci to install the published `vite-plus@0.1.14` instead of the local `vite-plus@0.0.0` tgz, failing the `verify-install.ts` check. Closes #1177
1 parent 73887c8 commit def3eb0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/cli/src/migration/migrator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ export function rewriteStandaloneProject(
720720
overrides: {
721721
...pkg.pnpm?.overrides,
722722
...VITE_PLUS_OVERRIDE_PACKAGES,
723+
...(isForceOverrideMode() ? { [VITE_PLUS_NAME]: VITE_PLUS_VERSION } : {}),
723724
},
724725
};
725726
// remove packages from `resolutions` field if they exist
@@ -734,7 +735,7 @@ export function rewriteStandaloneProject(
734735
extractedStagedConfig = rewritePackageJson(pkg, packageManager, false, skipStagedMigration);
735736

736737
// ensure vite-plus is in devDependencies
737-
if (!pkg.devDependencies?.[VITE_PLUS_NAME]) {
738+
if (!pkg.devDependencies?.[VITE_PLUS_NAME] || isForceOverrideMode()) {
738739
pkg.devDependencies = {
739740
...pkg.devDependencies,
740741
[VITE_PLUS_NAME]: VITE_PLUS_VERSION,

0 commit comments

Comments
 (0)