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
Commonjs export is not working #440
Comments
change it into |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a module which depends on cal-heatmap. In this module, I'm importing cal-heatmap via esm
I'm bundling this module with webpack using the umd target and because I do not want the bundle size of the module to be large, I've externalize
cal-heatmap
.Externalizing cal-heatmap causes it to be referenced in the module using the commonjs syntax,
require("cal-heatmap")
;But when I use the exported module in my project, the reference to
cal-heatmap
breaks the project. After hours of hair-pulling, I noticed that the global d3, d3-selection, d3-color and d3-fetch externalized incal-heatmap
is the root source of the issue. They are allundefined
when imported with commonjs syntaxThe text was updated successfully, but these errors were encountered: