Skip to content

Exclude certain Vite projects from being converted to vite-plus when I do vp migrate #3406

Description

@yangshun

Description

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.

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
  • Check that there isn't already an issue requesting the same feature.

Activity

  1. added theissue type on Nov 10, 2026
  2. fengmk2 commented on Nov 10, 2026

    @fengmk2
    Member

    Let me take a look.

  3. fengmk2 commented on Nov 10, 2026

    @fengmk2
    Member

    I propose adding migrate.ignorePatterns:

    export default defineConfig({
      migrate: {
        ignorePatterns: ['templates/', 'examples/'],
      },
    });

    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.

  4. yangshun commented on Nov 10, 2026

    @yangshun
    Author

    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.

  5. fengmk2 commented on Nov 10, 2026

    @fengmk2
    Member

    @yangshun You can try this lint config to disable the rule:

    lint: {
      overrides: [
        {
          files: ['templates/**', 'examples/**'],
          rules: {
            'vite-plus/prefer-vite-plus-imports': 'off',
          },
        },
      ],
    },
  6. fengmk2 commented on Nov 11, 2026

    @fengmk2
    Member

    @cpojer migrate.ignorePatterns What do you think of this configuration plan?

  7. cpojer commented on Nov 11, 2026

    @cpojer
    Member

    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?

  8. yangshun commented on Nov 11, 2026

    @yangshun
    Author
  9. yangshun commented on Nov 11, 2026

    @yangshun
    Author

    @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.

  10. fengmk2 commented on Nov 12, 2026

    @fengmk2
    Member

    @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. 🌮

  11. yangshun commented on Nov 12, 2026

    @yangshun
    Author

    I’ll first try refactoring a version that allows vp migrate to read the relevant lint configuration from vite-plus/prefer-vite-plus-imports.

    That's all I need, much appreciated. I also prefer keeping API surface smaller if possible :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmigrationVite+ migration related issues

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions