feat: add inlinedDependencies field to package.json#785
Merged
Conversation
Automatically populate the `inlinedDependencies` field in package.json when the `exports` option is enabled, listing dependencies that are physically inlined into the bundle with their exact versions. - Add `inlinedDeps` field to `TsdownBundle` to track inlined deps - Extract `parseBundledDep` in DepPlugin to resolve dep name and version - Merge inlined deps from all format builds (ESM + CJS) with dedup - Write `inlinedDependencies` to package.json via `writeExports` - Add `exports.inlinedDependencies` option to disable (default: true) Ref: e18e/ecosystem-issues#237
✅ Deploy Preview for tsdown-main ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
tsdown
create-tsdown
tsdown-migrate
commit: |
Adopt main's parameter destructuring style for DepPlugin while keeping the tsdownBundle parameter and always-run generateBundle handler.
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.
Description
Automatically populate the
inlinedDependenciesfield inpackage.jsonwhen theexportsoption is enabled. This field lists dependencies that are physically inlined into the bundle along with their exact versions, following Option B from the ecosystem proposal.Format:
Record<string, string | string[]>— maps package name to version(s).Key changes:
generateBundleviaparseBundledDepinDepPluginTsdownBundle.inlinedDepsasMap<string, Set<string>>inlinedDependenciestopackage.jsoninwriteExportsexports.inlinedDependenciesoption to disable the field (default:true)Linked Issues
Ref: e18e/ecosystem-issues#237
Additional context
Example output in
package.json:{ "inlinedDependencies": { "my-lib": "1.2.3", "another-lib": ["1.0.0", "2.0.0"] } }