Transitioning from lodash
to lodash-es
in my TypeScript project has been a challenge.
After installing lodash-es
and @types/lodash-es
, I encountered an error when compiling my project using webpack:
C:\..\node_modules\lodash-es\lodash.js:10
export { default as add } from './add.js';
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:1116:16)
at Module._compile (internal/modules/cjs/loader.js:1164:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
I'm unsure about the root cause of this issue and how to resolve it. Any suggestions?