Definitelytyped: [@ types / html-webpack-plugin] Suporte para webpack 5

Criado em 15 out. 2020  ·  3Comentários  ·  Fonte: DefinitelyTyped/DefinitelyTyped

@ types / html-webpack-plugin não suporta webpack 5 tipos que agora são gerados pelo próprio webpack.

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] Tentei usar o pacote @types/html-webpack-plugin e tive problemas.
  • [x] Tentei usar a versão estável mais recente do tsc. https://www.npmjs.com/package/typescript
  • [x] Eu tenho uma pergunta que é inadequada para StackOverflow . (Por favor, faça quaisquer perguntas apropriadas lá).
  • [x] [Mencione] (https://github.com/blog/821-mention-somebody-they-re-notified) os autores (ver Definitions by: em index.d.ts ) para que eles possam responder.

    • Autores: @deevus , @bumbleblym , @tlaziuk

Se você não mencionar os autores, o problema será ignorado.

Comentários muito úteis

mais recente html-webpack-plugin (v4.5.0) já tem sua própria definição de tipo e já suporta webpack 5. Não há necessidade de instalar @types/html-webpack-plugin

Todos 3 comentários

Instale html-webpack-plugin@next para compatível com webpack @ 5 que inclui a própria definição de tipo.

mais recente html-webpack-plugin (v4.5.0) já tem sua própria definição de tipo e já suporta webpack 5. Não há necessidade de instalar @types/html-webpack-plugin

eu encontro o mesmo problema com webpack5 e ts, você já resolveu este problema?

Esta página foi útil?
0 / 5 - 0 avaliações