Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

algoliasearch-client-javascript provide cjs, es, but does not support deduping #1421

Open
kopax-polyconseil opened this issue Jul 27, 2022 · 1 comment

Comments

@kopax-polyconseil
Copy link

kopax-polyconseil commented Jul 27, 2022

Hello,

We had a memory leak while building our application, and we were able to solve it by increasing the memory for node, but while investigating, we noticed this anomaly:

image

It seems the UMD module gets builded with webpack, while I can see that you are distributing ES and CJS format.

In your documentation here it is written:

Both versions come as UMD and ESM modules.

Inspecting at your package.json, it seems you are not defining the module, is it possible to release a version that fix the module as we rather not ship all of algoliasearch to our web clients.

Thanks in advance !

related issues

fix

We manage to fix it with webpack resolve.alias

@cedricls1
Copy link

cedricls1 commented Jul 27, 2022

This screenshots illustrate the potential gain of using CJS :

  • With UMD :
    Capture d’écran 2022-07-27 à 15 22 58
  • With CJS :
    Capture d’écran 2022-07-27 à 15 18 58

I used Webpack Bundle Analyzer to do this analyze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants