question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack version detection should use feature detection

See original GitHub issue

the webpack version is determined using a require, but this is problematic in monorepos where the location of this plugin and the location of webpack can be unexpected.

Is there some way to infer the version we’re dealing with from the compiler passed into apply?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:26 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
pmmmwhcommented, Jun 1, 2021

Hi @ndelangen @rdsedmundo -

I’ve implemented proper version detection and pass-through imports on the compiler instance for Webpack 5 in #415. Would you mind testing it out in your projects?

npm install -D -S git://github.com/pmmmwh/react-refresh-webpack-plugin.git#feat/feature-detection
yarn add -D git://github.com/pmmmwh/react-refresh-webpack-plugin.git#feat/feature-detection
pnpm add -D git://github.com/pmmmwh/react-refresh-webpack-plugin.git#feat/feature-detection

I’ll merge that once I got around to fill out tests for the changes and we can confirm that the PR works in reality.

1reaction
rdsedmundocommented, Jun 1, 2021

It worked for my project. Thanks for working on that! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Implementing feature detection - Learn web development | MDN
Feature detection involves working out whether a browser supports a certain block of code, and running different code depending on whether it ...
Read more >
Hot Module Replacement - webpack
This feature is great for productivity. All we need to do is update our webpack-dev-server configuration, and use webpack's built-in HMR plugin.
Read more >
Feature detection in Javascript - The Publishing Project
Rather than use browser detection, the current best practice is to use feature detection to see if a browser supports a given feature....
Read more >
feature-detect - npm
Feature detection library for node environments.. Latest version: 1.0.0, last published: 8 years ago. Start using feature-detect in your ...
Read more >
Webpack | WebStorm Documentation - JetBrains
In projects that consist of multiple modules with different webpack configurations, WebStorm can automatically detect the relevant configuration ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found