Skip to content

Conversation

@drauggres
Copy link

Fix issue:

TS2322: Type 'GeneratePackageJsonPlugin' is not assignable to type '((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance'.

  • webpack@5 has its own ts-declaraions (no need for @types/webpack)
  • Plugin is not exported from webpack in webpack@5 (is it WebpackPluginInstance now?)

Though it is possible to remove @types/webpack from the package.json and change parent class to WebpackPluginInstance it will break compatibility with webpack@4.

With this change plugin works with both webpack@4 and webpack@5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant