Skip to content

Conversation

@aramissennyeydd
Copy link
Contributor

Summary

This PR allows the webpack plugin to use the installed version of webpack in the project before resorting to the rig level one.

Details

Have been trying to add better enforcement of webpack dependencies to prevent phantom deps. Started running into issues with this line in webpack, https://github.com/webpack/webpack/blob/main/lib/NormalModule.js#L274-L278 where it expects a single instance of webpack to be used between the project and the rig running the project. If I install webpack directly at the project level, it will (sometimes) explode because the instances are no longer guaranteed to match.

How it was tested

Tested this change locally against our repo and saw a successful build. Let me know if I should add a build-tests for this, I either have to add a stale webpack version or add a contrived peer dependency resolution which seemed less than maintainable.

Impacted documentation

Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
aramissennyeydd and others added 4 commits October 6, 2025 15:07
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
@dmichon-msft
Copy link
Contributor

Could you add a build test project to the repository that loads webpack from the project and has a fake webpack config that verifies that the version of "webpack" matches? You will likely either need to install a distinct version of webpack or have it be a link to a fake implementation that only has the bare minimum API.

Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
@aramissennyeydd
Copy link
Contributor Author

@dmichon-msft I copied set-webpack-public-path-plugin-test over to a new package, let me know if I should add any extra validation here.

Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
@iclanton iclanton merged commit 8fc1744 into microsoft:main Oct 7, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants