aspect-build / rules_webpack

Bazel rules for webpack bundler https://webpack.js.org/
Apache License 2.0
32 stars 15 forks source link

[Bug]: entry_point doesn't override webpack.config if the config contains `entry: {}` #145

Open Aghassi opened 8 months ago

Aghassi commented 8 months ago

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

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=<file>` and see it work

Any other information?

No response