To decrease the size of my Angular project bundle, I am individually installing and importing lodash libraries like lodash.clonedeep
and other lodash.*
. However, I am losing type definitions for these since they do not work with the @types/lodash npm package.
I have searched online to find a way to alias the type definitions, but unfortunately, I haven't found any solution yet.
const cloneDeep = require('lodash.clonedeep');
import { cloneDeep } from 'lodash';
The first method does not provide type information in my IDE, whereas the second one does because it uses @types/lodash.