Definitelytyped: [@ types / html-webpack-plugin] Compatibilidad con webpack 5

Creado en 15 oct. 2020  ·  3Comentarios  ·  Fuente: DefinitelyTyped/DefinitelyTyped

@ types / html-webpack-plugin no admite los tipos de webpack 5 que ahora son generados por el propio 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] Intenté usar el paquete @types/html-webpack-plugin y tuve problemas.
  • [x] Intenté usar la última versión estable de tsc. https://www.npmjs.com/package/typescript
  • [x] Tengo una pregunta que no es apropiada para StackOverflow . (Haga las preguntas correspondientes allí).
  • [x] [Mencione] (https://github.com/blog/821-mention-somebody-they-re-notified) a los autores (consulte Definitions by: en index.d.ts ) para que puedan responder.

    • Autores: @deevus , @bumbleblym , @tlaziuk

Si no menciona a los autores, se ignorará el problema.

Comentario más útil

el último html-webpack-plugin (v4.5.0) ya tiene su propia definición de tipo y ya es compatible con el paquete web 5. No es necesario instalar @types/html-webpack-plugin

Todos 3 comentarios

Instale html-webpack-plugin@next para que sea compatible con webpack @ 5 que incluye la definición de tipo en sí.

el último html-webpack-plugin (v4.5.0) ya tiene su propia definición de tipo y ya es compatible con el paquete web 5. No es necesario instalar @types/html-webpack-plugin

Encuentro el mismo problema con webpack5 y ts, ¿has resuelto este problema?

¿Fue útil esta página
0 / 5 - 0 calificaciones