Repository navigation
fix: exclude test files matched by wildcard package exports in production mode - #2083
Merged
webpro merged 2 commits intoOct 1, 2026
Merged
Conversation
β¦in production mode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RocMt6KQsTi6y25xAphdsr
β¦ction mode Apply the negated non-production entry patterns to the production glob for plugin and manifest entries, as production mode already does for user entry patterns and project files. Remove the null package entry point fixture. Its test passed only because of the vitest negation, not because of the null key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RocMt6KQsTi6y25xAphdsr
6 tasks done
commit: |
Member
|
Thanks for the fix and reproduction! CI is green, and this resolves the production-mode report in #2082. |
Member
|
π This pull request is included in v6.40.0. See Release 6.40.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
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.
Closes #2082
In production mode,
getEntrySpecifiersFromManifestexpandsexportsinto concrete files early and globs them as production entries. That glob doesn't get the non-production entry negations. A wildcard like"./*": "./src/*.ts"therefore makessrc/math.test.tsa production entry, and exports imported only by tests go unreported.This change adds
negatedEntryPatternsto the production glob for plugin and manifest entries. Production mode already applies these negations to userentrypatterns (getProductionEntryFilePatterns) and to project files. Outside production the list is empty, so default mode is unchanged.Tests
package-entry-points-test-filescovers both modes:subtract, imported only bysrc/math.test.ts, is now reported.Local results:
node --testandbun test.isProductionorisStrictpasses, along with the tsup, tsdown, rslib and preconstruct plugin tests.node scripts/run-test.js --smokepasses except for the watch test, which also fails onmain.Behaviour changes
entryglobs) go through the same glob. In production, a bundler entry glob that matches test files no longer includes them. This is the same class of issue.entryandproductiondeclare overlapping patterns.mainis the file anode --watchdev script runs gives the same output as before.π€ Generated with Claude Code
https://claude.ai/code/session_01RocMt6KQsTi6y25xAphdsr