Definitelytyped: [@types/html-webpack-plugin] Support for webpack 5

Created on 15 Oct 2020  ·  3Comments  ·  Source: DefinitelyTyped/DefinitelyTyped

@types/html-webpack-plugin doesn't support webpack 5 types which are now generated by webpack itself.

node_modules/@types/html-webpack-plugin/index.d.ts:9:10 - error TS2305: Module '"../../webpack/types"' has no exported member 'Plugin'.

9 import { Plugin, compilation, Compiler } from 'webpack';
           ~~~~~~

node_modules/@types/html-webpack-plugin/index.d.ts:9:18 - error TS2724: Module '"../../webpack/types"' has no exported member 'compilation'. Did you mean 'Compilation'?

9 import { Plugin, compilation, Compiler } from 'webpack';
                   ~~~~~~~~~~~
  • [x] I tried using the @types/html-webpack-plugin package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @deevus, @bumbleblym, @tlaziuk

If you do not mention the authors the issue will be ignored.

Most helpful comment

latest html-webpack-plugin (v4.5.0) already has its own type definition, and already support webpack 5. No need to install @types/html-webpack-plugin

All 3 comments

Install html-webpack-plugin@next to compatible with webpack@5 that includes type definition itself.

latest html-webpack-plugin (v4.5.0) already has its own type definition, and already support webpack 5. No need to install @types/html-webpack-plugin

i meet the same problem with webpack5 and ts, hav you solve this problem?

Was this page helpful?
0 / 5 - 0 ratings