You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exclude certain Vite projects from being converted to vite-plus when I do vp migrate #3406
I have a Vite+ monorepo that contains many example/boilerplate projects that use Vite.
When I run vp migrate, the vite imports in those projects got converted to vite-plus. Those projects should stay on vite as they are meant to be cloned and used independently.
Is there a way to exclude certain Vite projects from being converted to vite-plus when I do vp migrate? I read the docs and asked AI but didn't manage to find a good way.
Suggested solution
Possibly an exclude field in vite.config.ts but only for this vite-plus migration.
I just want to exclude the specific vite -> vite-plus change during vp migrate (and possibly other related changes like vitest -> vite-plus/test). I still want to be able to do monorepo operations for those template projects, as well as any other reasonable migration changes.
Patterns would follow .gitignore semantics, relative to the root config directory, including ordered negation with !.
The intended behavior:
Excluded paths stay unchanged during migration, including dependencies, scripts, configs, imports, and migration-triggered formatting. Workspace membership stays unchanged.
Lint autofix respects the same exclusions for vite-plus/prefer-vite-plus-imports. Other lint rules still apply.
Shared catalog entries needed by excluded packages are preserved. Migrated packages can use separate entries or explicit dependency specs.
Existing root overrides remain effective. If migration requires an override change that conflicts with excluded packages, report it before modifying files.
I’ll add snapshot coverage for template exclusion, pattern matching, shared catalogs/overrides, and subsequent lint autofix, including migration reruns.
Amazing, thank you! Today is it possible for me to switch off only the lint rule vite-plus/prefer-vite-plus-imports autofix for those directories? If so then I can just do that and Vite Plus won't need any changes.
Make sense to me, but it's a pretty specific use case and you might need more options in the future to migrate only parts of a package (like yes for the lint config, no for vite or similar?). I feel like disabling the lint rule + telling an agent to "run vp migrate but don't change Vite imports" is good enough?
Yeah I think lint rules would be enough, don't need to expand the config for this rare use case. Can always add in future if more people request.
Sorry I haven't got to test the lint rules yet but it should work.
@fengmk2 Tested on 1.6.0 with vite-plus/prefer-vite-plus-imports disabled for my directories (templates/** and questions/**). The override works for lint autofix, but vp migrate still rewrites 34 files in those directories.
Migration seems to use its own import rewriter independently of the lint rule. Could that migration step respect the same lint override? That would cover this use case without adding another config option.
@cpojer@yangshun Your suggestion makes a lot of sense. I’ll first try refactoring a version that allows vp migrate to read the relevant lint configuration from vite-plus/prefer-vite-plus-imports.
For now, I’ll try not to add any new configuration. Once we have enough requests, we can consider adding dedicated configuration for migrate. 🌮
Activity
fengmk2 commentedon Nov 10, 2026
Let me take a look.
fengmk2 commentedon Nov 10, 2026
I propose adding
migrate.ignorePatterns:Patterns would follow
.gitignoresemantics, relative to the root config directory, including ordered negation with!.The intended behavior:
vite-plus/prefer-vite-plus-imports. Other lint rules still apply.I’ll add snapshot coverage for template exclusion, pattern matching, shared catalogs/overrides, and subsequent lint autofix, including migration reruns.
yangshun commentedon Nov 10, 2026
Amazing, thank you! Today is it possible for me to switch off only the lint rule
vite-plus/prefer-vite-plus-importsautofix for those directories? If so then I can just do that and Vite Plus won't need any changes.fengmk2 commentedon Nov 10, 2026
@yangshun You can try this lint config to disable the rule:
fengmk2 commentedon Nov 11, 2026
@cpojer
migrate.ignorePatternsWhat do you think of this configuration plan?cpojer commentedon Nov 11, 2026
Make sense to me, but it's a pretty specific use case and you might need more options in the future to migrate only parts of a package (like yes for the lint config, no for vite or similar?). I feel like disabling the lint rule + telling an agent to "run vp migrate but don't change Vite imports" is good enough?
yangshun commentedon Nov 11, 2026
yangshun commentedon Nov 11, 2026
@fengmk2 Tested on 1.6.0 with
vite-plus/prefer-vite-plus-importsdisabled for my directories (templates/**andquestions/**). The override works for lint autofix, butvp migratestill rewrites 34 files in those directories.Migration seems to use its own import rewriter independently of the lint rule. Could that migration step respect the same lint override? That would cover this use case without adding another config option.
fengmk2 commentedon Nov 12, 2026
@cpojer @yangshun Your suggestion makes a lot of sense. I’ll first try refactoring a version that allows
vp migrateto read the relevant lint configuration fromvite-plus/prefer-vite-plus-imports.For now, I’ll try not to add any new configuration. Once we have enough requests, we can consider adding dedicated configuration for
migrate. 🌮yangshun commentedon Nov 12, 2026
That's all I need, much appreciated. I also prefer keeping API surface smaller if possible :)