aspect-build / aspect-build/rules_webpack
[Bug]: entry_point doesn't override webpack.config if the config contains `entry: {}`
- Dominant language
- Starlark
- Stars
- 33
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
### What happened?
If your webpack config contains `entry: {}` being set, the rule will not override even if you pass `entry_point`. You need to pass args `--entry-reset` and then entry points you care about to do so. This also has the side effect of exposing that `args` doesn't interpolate and expand `format` strings. #144 was an attempt to fix this partially, but not a good one.
https://webpack.js.org/api/cli/#entry
### Version
Development (host) and target OS/architectures:
Output of `bazel --version`:
6.4.0
Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:
Language(s) and/or frameworks involved:
### How to reproduce
```shell
Create a webpack config with `entry` set
Set a rule that overrides entry with `entry_point`
Bazel run or build that target and see the entry point is not overridden
Pass `args` to the rule that then sets `--entry-reset --entry=` and see it work
```
### Any other information?
_No response_
Contributor guide
Research direction
Start by reproducing the issue with a webpack config containing `entry: {}` and a rule using `entry_point`, then compare it with explicit `--entry-reset` and `--entry` arguments. Trace how the rule constructs webpack CLI arguments, including `args` format interpolation. Done means `entry_point` overrides the configured entry without manual reset arguments and existing argument handling remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- webpack
- Domain
- build-system, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100