Skip to content

feat: add path mapping support to webpack_bundle - #214

Open
acozzette wants to merge 6 commits into
aspect-build:mainfrom
acozzette:path-mapping
Open

feat: add path mapping support to webpack_bundle#214
acozzette wants to merge 6 commits into
aspect-build:mainfrom
acozzette:path-mapping

Conversation

@acozzette

Copy link
Copy Markdown
Contributor

Set the supports-path-mapping execution requirement on the Webpack action so that builds which differ only in compilation mode (e.g. -c fastbuild vs -c opt) can share a single cached action. Support is only advertised when none of the env values expand via location or Make variable expansion, since those can produce paths that aren't path mapped.

Add an e2e test (e2e/path_mapping) that builds a webpack_bundle target under -c fastbuild then -c opt with a shared --disk_cache and asserts the second build's action is served from cache.


Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: yes

Add path mapping support to webpack_bundle.

Test plan

  • Covered by existing test cases
  • New test cases added

Comment thread e2e/loaders/MODULE.bazel
bazel_dep(name = "aspect_rules_js", version = "3.2.1", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True)

git_override(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self that I need to delete these overrides and use a released rules_js version before merging this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we need to land in rules_js before tagging a release there? Overall I think this PR LGTM but I'd rather drop the git_overrides...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this PR needs is js_run_binary_action, and that has already landed on main in rules_js. So for the purpose of this PR we could tag a rules_js release now. I do still need to land at least one more change in rules_js to get path mapping working with js_run_binary, though, so I don't know if we want to wait for that or not.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd vote to keep this PR open until we have tested js_run_binary_action more before tagging a release. Maybe also getting rules_ts working before tagging a rules_js release to make sure the API is good?

@acozzette
acozzette force-pushed the path-mapping branch 3 times, most recently from 07a07b0 to 08952cf Compare July 30, 2026 22:57
@acozzette
acozzette marked this pull request as ready for review July 31, 2026 21:46
@acozzette
acozzette requested a review from jbedard July 31, 2026 21:47
Comment thread .github/workflows/ci-workflows.yaml Outdated
Comment thread webpack/private/webpack_bundle.bzl
Set the `supports-path-mapping` execution requirement on the Webpack
action so that builds which differ only in compilation mode (e.g.
-c fastbuild vs -c opt) can share a single cached action. Support is
only advertised when none of the `env` values expand via location or
Make variable expansion, since those can produce paths that aren't
path mapped.

Add an e2e test (e2e/path_mapping) that builds a webpack_bundle target
under -c fastbuild then -c opt with a shared --disk_cache and asserts
the second build's action is served from cache.
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.

2 participants