konnectors/libs

Critical dependency in webpack

Closed this issue · 2 comments

When importing cozy-konnector-libs with webpack, several warnings are triggered, all saying: Critical dependency: the request of a dependency is an expression.

As stated in #56, it is caused by dynamic requires, this time made here, here and in the bindings package.

There are some ways to get rid of these warnings in webpack, but it would be even better to avoid them in the first place, at least in the cozy-konnector-libs parts :) I am not sure about the implications, though.

@Gara64 Here is a PR for the easy fixes.

For the bindings package, since we cannot change it, we should hide the warning. What I understand is that the best way here is to add an option to webpack config file.

But the webpack config is in each connector. I will then update the connector template accordingly : konnectors/cozy-konnector-template#167

And we will update the different connectors later.

Thanks for this precise issue @Gara64 👍