Bad type declaration in "clean-webpack-plugin.d.ts"
AxelEric opened this issue · comments
AxelEric commented
Issue description or question
clean-webpack-plugin.d.ts
-
have a wrong type declaration due to a bad use of ´import´ syntax.
Your code ...
import { Compiler, Stats, compilation as compilationType } from 'webpack';
declare type Compilation = compilationType.Compilation;
-
This give a type
any
to your Declared tyoeCompilation
.Correction proposal ...
import { Compiler, Stats, Compilation as CompilationType } from 'webpack';
declare type Compilation = CompilationType;
- Another way is to, simpy forget your Type declaration ...
import { Compiler, Stats, Compilation } from 'webpack';
...//...
handleInitial(compilation: typeof Compilation): void;
- I'm not even sure 'typeof' is needed ...
Webpack Config
Not usefull
Environment
- For the fun ...
System:
OS: Windows 10 10.0.17763
CPU: (8) x64 Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz
Memory: 11.54 GB / 15.99 GB
Binaries:
Node: 14.11.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - D:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
npmPackages:
clean-webpack-plugin: ^3.0.0 => 3.0.0
webpack: ^5.11.0 => 5.11.0
Keep smyling
AxelEric.
Daniel Cassidy commented
Note this is due to incompatibility with the type declarations provided by webpack 5.