wearemothership / dicom.ts

A small, fast, javascript DICOM renderer
Other
35 stars 13 forks source link

CharLS and OpenWASM use NodeJS Modules #28

Open vespasianvs opened 2 years ago

vespasianvs commented 2 years ago

dicom.ts is a UI module, but it is using NodeJS modules (fs and path) in CharLS and OpenWASM components. This means that in Webpack5 the polyfills need adding manually (webpack5 removes default NodeJS polyfills) and can cause problems for future users. Suggest switching the imports to:

path -> path-browserify fs -> graceful-fs

nickhingston commented 1 year ago

The imports are all around has node checks - e.g. ENVIRONMENT_IS_NODE , so I'm not sure I see the problem here? For browser we inject the wasm with raw.macro

moritzmhmk commented 1 year ago

I fixed this issue for my dicom-parser by re-building CharLS etc. with appropriate flags generating a separate entry point for web use. You can find the forks here.