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
From node.js it is possible to import just a single codec, but this does not seem to work from a browser-targeted build using typescript/webpack. Typescript gives the error:
import{Blosc}from'numcodecs/blosc';
Cannot find module 'numcodecs/blosc' or its corresponding type declarations.
Using
import{Blosc}from'numcodecs';
works but also pulls in pako, which increases the bundle size a fair bit.
The text was updated successfully, but these errors were encountered:
Hi, thanks for opening the issue. Yes, Node's conditional exports are not well supported by blunders currently (unfortunately). There is an issue here fore rollup, but it seems like it's landed in Webpack 5 from what I've been able to find.
Each codec is bundled separately using code splitting, and is the default export from module, so the import shouldn't have the brackets.
importBloscfrom'numcodecs/blosc';// not { Blosc }
I'm not sure if webpack has tree-shaking, but it shouldn't have a hard time doing so. The main entry point is just exporting each of the separate codecs.
From node.js it is possible to import just a single codec, but this does not seem to work from a browser-targeted build using typescript/webpack. Typescript gives the error:
Using
works but also pulls in pako, which increases the bundle size a fair bit.
The text was updated successfully, but these errors were encountered: