wa0x6e / cal-heatmap

Cal-Heatmap is a javascript charting library to create a time-series calendar heatmap
http://cal-heatmap.com
MIT License
2.7k stars 292 forks source link

fix(vite): The above dynamic import cannot be analyzed by Vite. #518

Open yqchilde opened 5 months ago

yqchilde commented 5 months ago

The above dynamic import cannot be analyzed by Vite. See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the / @vite-ignore / comment inside the import() call to suppress this warning.

image
yqchilde commented 5 months ago

Perhaps this change does not solve the problem, as the import uses' cal heatmap. esm. js', and I changed it here using 'patch package':


-      return import("dayjs/locale/".concat(userLocale, ".js"));
+      return import(/* @vite-ignore */ "dayjs/locale/".concat(userLocale, ".js"));
```+