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 #56

Closed pmeinhardt closed 3 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.

Summary of changes:

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. ✌️

tschmidtb51 commented 3 years ago

@pirelenito: Could you please review that PR, merge if possible and publish a new version?

pirelenito commented 3 years ago

Thanks for pushing this PR and for waiting for so long to get this finally in a version bump.

I just released v4.0.0 that includes official support for Webpack 5, plus TypeScript type definitions.