pirelenito / git-revision-webpack-plugin

🏗 Webpack plugin that generates VERSION and COMMITHASH files during build
https://www.npmjs.com/package/git-revision-webpack-plugin
MIT License
358 stars 48 forks source link

Fix webpack 5 deprecation warnings #55

Closed pmeinhardt closed 4 years ago

pmeinhardt commented 4 years ago

After upgrading to webpack 5 I got the following deprecation warning:

(node:14132) [DEP_WEBPACK_MAIN_TEMPLATE_ASSET_PATH] DeprecationWarning: MainTemplate.hooks.assetPath is deprecated (use Compilation.hooks.assetPath instead)
    at /Users…/node_modules/git-revision-webpack-plugin/lib/build-file.js:16:46

This adjusts the plugin code to the new webpack APIs as per the warning.

Closes https://github.com/pirelenito/git-revision-webpack-plugin/issues/50

Note: I opened this PR against the master branch. It includes 2 commits from the v3 branch that have apparently not been propagated to master. Not sure whether that was intentional/what the desired PR target branch should be. ✌️

pmeinhardt commented 4 years ago

Argh. Tests are failing. Need to double-check my changes. 🕵️