@types/html-webpack-plugin ne prend pas en charge les types webpack 5 qui sont désormais générés par webpack lui-même.
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';
~~~~~~~~~~~
@types/html-webpack-plugin
et j'ai eu des problèmes.Definitions by:
dans index.d.ts
) afin qu'ils puissent répondre.Si vous ne mentionnez pas les auteurs, le problème sera ignoré.
Installez html-webpack-plugin@next
pour être compatible avec webpack@5 qui inclut la définition de type elle-même.
le dernier html-webpack-plugin
(v4.5.0) a déjà sa propre définition de type et prend déjà en charge le webpack 5. Pas besoin d'installer @types/html-webpack-plugin
je rencontre le même problème avec webpack5 et ts, avez-vous résolu ce problème ?
Commentaire le plus utile
le dernier
html-webpack-plugin
(v4.5.0) a déjà sa propre définition de type et prend déjà en charge le webpack 5. Pas besoin d'installer@types/html-webpack-plugin