fix(init): auto-fix git symlinks when core.symlinks is false#1353
Merged
fengmk2 merged 1 commit intovoidzero-dev:mainfrom Apr 10, 2026
Merged
fix(init): auto-fix git symlinks when core.symlinks is false#1353fengmk2 merged 1 commit intovoidzero-dev:mainfrom
core.symlinks is false#1353fengmk2 merged 1 commit intovoidzero-dev:mainfrom
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
Member
|
@cursor review |
fengmk2
approved these changes
Apr 10, 2026
Member
|
@T4ko0522 Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This repository contains git symlinks in
packages/core/that reference files in the upstreamvite/directory:
packages/core/vite-rolldown.config.ts→../../vite/packages/vite/rolldown.config.tspackages/core/rollupLicensePlugin.ts→../../vite/packages/vite/rollupLicensePlugin.tsIn a fresh Windows clone of this repository,
core.symlinkscan befalse. In that case, git checksout these entries as plain text files containing the target path instead of actual symlinks. This
causes the build to fail with
Unexpected token, because the files are imported as TypeScript modulesbut only contain a path string.
Solution
Add a
_fix_symlinksrecipe tojustfileand run it as part ofjust init. The recipe checkscore.symlinks, and when it is nottrue, it enables it and re-checks out all tracked symlinkentries.
Both unix and Windows implementations are included.
The recipe is idempotent: when
core.symlinks=true, it does nothing.Test plan
git cloneof this repository thatcore.symlinks=falseand thesymlinks are checked out incorrectly
just _fix_symlinkson Windows via PowerShell and confirmed the symlinks were restored_fix_symlinkscommands manually in Git Bash and confirmed the symlinks were restoredcore.symlinks=trueis a no-op