Skip to content

feat: skip gitignored paths and build output directories in discovery - #528

Open
deodad wants to merge 1 commit into
wevm:mainfrom
deodad:feat/discovery-ignores
Open

deodad wants to merge 1 commit into
wevm:mainfrom
deodad:feat/discovery-ignores

Conversation

@deodad

@deodad deodad commented Nov 11, 2026

Copy link
Copy Markdown

Discovery parsed every non-skipped module under the root. Only dist, build, and dotfiles were skipped, so leftover bundles in folders such as dist-preview/ were parsed on every build. 8 MB of stale bundles took a build from 1.0 s to 4.4 s.

Ignores.create (new, src/node/internal/Ignores.ts) reads .gitignore files from the repository root down, or from the scanned directory outside a repository, including negations. The Vite plugin's discovery and zyzz.config.* search skip ignored paths and each environment's build.outDir, unless the output directory contains a source directory (such as outDir: '..'). The portable adapters' scan applies the same rules and skips esbuild's outdir.

app/
├── dist-preview/   # skipped: listed in .gitignore
├── out/            # skipped: build.outDir
└── src/
Same page, 8 MB of stale bundles in gitignored dist-*/ folders Before After
vite build 4.35 s 1.02 s

No change for a clean project. Output CSS is identical.

Validation: new skips ignored files and build output in discovery scenario (fails without the change), tsc, and the same suites (211 tests) pass.

Merging this after #527 leaves one conflict in configResolved of src/vite/index.ts: keep both the transform-filter block and the outDirs block.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant