wa0x6e/cal-heatmap

CSS file is not exported from the package

spookylukey opened this issue · 2 comments

I'm attempting to use cal-heatmap with Webpack. In this configuration, you normally do:

import 'cal-heatmap/cal-heatmap.css';

This used to work with older versions of cal-heatmap, but now that the exports fields is defined in package.json, I get this:

Module not found: Error: Package path ./cal-heatmap.css is not exported from package node_modules/cal-heatmap (see exports field in node_modules/cal-heatmap/package.json)

As far as I can see, the fix is simply to add the file to the exports as below:

"exports": {
    ".": {
      "import": "./dist/cal-heatmap.esm.js",
      "require": "./dist/cal-heatmap.js"
    },
    "./cal-heatmap.css": "./dist/cal-heatmap.css",
    "./package.json": "./package.json"
  },

I have tested this locally, just editing the package.json file in my node_modules, and it seems to work.
Thanks!

Fixed in beta 12

Thanks!