Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

fix: determine webpack peer dependency version #296

Merged
merged 1 commit into from Oct 16, 2020

Conversation

Knagis
Copy link
Contributor

@Knagis Knagis commented Oct 15, 2020

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Fixes #295

Breaking Changes

Additional Info

@jsf-clabot
Copy link

jsf-clabot commented Oct 15, 2020

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Oct 15, 2020

Codecov Report

Merging #296 into master will decrease coverage by 0.32%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #296      +/-   ##
==========================================
- Coverage   76.35%   76.02%   -0.33%     
==========================================
  Files           6        6              
  Lines         148      146       -2     
  Branches       52       51       -1     
==========================================
- Hits          113      111       -2     
  Misses         30       30              
  Partials        5        5              
Impacted Files Coverage Δ
src/index.js 95.00% <100.00%> (-0.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae94796...7c8a806. Read the comment docs.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

We can merge it, but I am afraid you will get this problems with other plugins/loaders too, because many of them use const webpack = require('webpack')

@Knagis
Copy link
Contributor Author

Knagis commented Oct 15, 2020

We can merge it, but I am afraid you will get this problems with other plugins/loaders too, because many of them use const webpack = require('webpack')

require("webpack") is completely fine - it picks up the peer dependency, so I can control which version which loader picks up.

the problem here is require('webpack/lib/web/FetchCompileWasmPlugin'). nodejs does not find the file in webpack 4 folder and thus walks up the directory chain and searches elsewhere.

in fact, without this change in the hoisted scenario parts like ExternalsPlugin is loaded from webpack 4, but FetchCompileWasmPlugin gets loaded from webpack 5

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Let's merge

@alexander-akait alexander-akait merged commit 8c63449 into webpack-contrib:master Oct 16, 2020
TheLD6978 pushed a commit to TheLD6978/worker-loader that referenced this pull request Apr 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

worker-loader picks up webpack5 from parent folder, not webpack4 from peer
3 participants