-
Notifications
You must be signed in to change notification settings - Fork 21
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
Use module type "es2015" or newer instead of commonjs #28
Comments
I get this build error when using nextjs 12
|
This should be fixed in the latest version, let me know if it's not. |
It works for me I use this server side and client side, maybe I can skip that on the server?, but I have to use transpiration to not get a server side error
|
Gotcha, ya my next thing to do is support both common JS and ESM with a dual setup, before it was just common JS. I haven't done that before so anyone reading this who is familiar feel free to reach out or set up a PR :) |
I'm wondering if there is any reason that this module is being built using "commonjs" in the tsconfig?
CommonJS modules are not tree shakable by webpack which results in increased bundle sizes (and compiler warnings). (see: https://webpack.js.org/guides/tree-shaking/ )
For reference: Apollo client builds an es2015 module. I think this is probably a safe default. I don't imagine this would impact anything other than reduced bundle size for those importing the library.
Happy to put in a PR with this change, I opened another PR which will drop your bundle size by not exporting the entirety of lodash with your package.
The text was updated successfully, but these errors were encountered: