You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a module which depends on cal-heatmap. In this module, I'm importing cal-heatmap via esm
importCalHeatmapfrom"cal-heatmap";
...
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 in cal-heatmap is the root source of the issue. They are all undefined when imported with commonjs syntax
The text was updated successfully, but these errors were encountered:
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: