jonschlinkert / merge-deep

Recursively merge values in a JavaScript object.

Home Page:https://github.com/jonschlinkert

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misuse of CommonJS

TobiaszCudnik opened this issue · comments

From webpack:

WARNING in ./node_modules/merge-deep/utils.js
7:34-41 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./node_modules/merge-deep/utils.js
 @ ./node_modules/merge-deep/index.js

You or webpack?

I'm getting this error too when bundling this library in with Webpack. Seems like ES6 import isn't supported with this library. Are there plans to have this library work with import statements?

import merge from 'merge-deep' gives the above error.

@fabio-b the correct syntax would be import * as merge from 'merge-deep' since merge-deep doesn't export a method named merge.

@TobiaszCudnik use the unlazy-loader in your webpack config if you're getting that error.