6

I try use the library ladash but I´m getting the next error:

Module not found: Error: Can't resolve 'lodash' in

I import the library as:

import _ from 'lodash';

This is the webpack config:

{
  loader: 'babel-loader',
  test: /\.js$/,
  exclude: /node_modules/,
  options: {
     plugins: ['lodash'],
     presets: [['env', { modules: false, targets: { node: 4 } }]]
  }
}

......
......
plugins: [
   new LodashModuleReplacementPlugin,
   new webpack.optimize.UglifyJsPlugin
]

and this is my package json dependencies:

enter image description here

Juan Reina Pascual
  • 3,988
  • 7
  • 21
  • 34

1 Answers1

1

Running npm install will solve your error!

Sonia Singla
  • 102
  • 6