Expose webpack version in the `compiler` object passed to plugins
See original GitHub issueDo you want to request a feature or report a bug? feature
What is the current behavior?
When writing a plugin whose goal is compatibility with both the legacy and webpack v4 plugin system, it’s something of a manual process to determine which version of webpack we’re running under. It would likely involve loading the webpack/package.json
that applies to the current compilation, and interpreting the data from there.
If the current behavior is a bug, please provide the steps to reproduce. n/a
What is the expected behavior?
It would be much cleaner if the webpack version were exposed as a property of the compiler
object, and passed through to plugins. The plugin would still need to know how to do semver comparisons, but at least it wouldn’t also need to know how to find the right package.json
and parse it.
If this is a feature request, what is motivation or use case for changing the behavior? See https://github.com/GoogleChrome/workbox/issues/1151#issuecomment-360964776 for more context.
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System. webpack v4
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
🙇
On Tue, Jan 30, 2018, 10:52 AM Jeffrey Posnick notifications@github.com wrote:
@jeffposnick should be enough.