Skip to content

feat(lib): add originalSource to BundleOptions for bundler module resolution - #619

Open
eduardomourar wants to merge 1 commit into
open-constructs:mainfrom
eduardomourar:feat/lib-original-source-bundle-options
Open

eduardomourar wants to merge 1 commit into
open-constructs:mainfrom
eduardomourar:feat/lib-original-source-bundle-options

Conversation

@eduardomourar

Copy link
Copy Markdown
Contributor

Related issue

Fixes #544

Description

  • Add originalSource field to BundleOptions interface to provide bundlers with the unfiltered asset source path
  • Pass originalSource (the real asset location before exclusions) alongside source (filtered copy) when calling bundler.bundle()
  • Forward originalSource through ChainBundler to all bundler legs
  • Update AssetStaging to resolve and pass the original sourcePath as originalSource
  • Add tests verifying bundlers receive correct originalSource when exclusions are configured
  • Enables bundlers to resolve node_modules, lockfiles, and symlinks relative to the asset's actual location instead of filtered scratch directories

Checklist

  • I have updated the PR title to match CDKTN's style guide
  • I have run the linter on my code locally
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation if applicable
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works if applicable
  • New and existing unit tests pass locally with my changes

@eduardomourar
eduardomourar requested a review from a team as a code owner November 14, 2026 20:08
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.

lib: bundlers lose the source's location when the asset sets exclude or ignoreStrategy

1 participant