Open RomainGaillardLesEchos opened 3 years ago
This is because @types/webpack-node-externals is targeting webpack@4 typings provided by DT, conflicting with webpack@5 which comes shipped with its own typings (see related issues #51712 and #49755).
There doesn't seem to be a easy solution within the context of DT since any solution would come with unwanted side-effects.
Easiest solution would be for webpack-node-externals
to include typings itself so that it no longer depended on DT.
Workaround for now:
import type { Configuration } from 'webpack';
export default function config(): Configuration ({
externals: [
nodeExternals(),
] as Configuration['externals'],
});
We are facing this issue (webpack 5):
Type
Configuration
is provided by webpack version ^5.36.2 and webpack-node-externals version ^3.0.0Any idea ?