webpack integration
See original GitHub issueHi, I am trying to use the library in my react component and having trouble to integrate it with webpack. The bottleneck is the integration of minified codec and webworker scripts.
I modified the dicom file example but the loadImage method didn’t work, so I turned off the webworkers.
Then I realized that the codec OpenJPEG wasn’t loading and resulted in this error
Imports in my react component:
import * as cornerstone from 'cornerstone-core';
import * as cornerstoneTools from 'cornerstone-tools';
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
import 'OpenJPEG';
Cornerstone’s OpenJPEG github says the codec should be loaded from the js file as a global object.
I tried to bundle it with webpack, as an external:
externals: {
OpenJPEG: {
root: [path.join(VENDOR_ROOT, 'openJPEG-FixedMemory'), 'OpenJPEG'],
},
},
but it didn’t work. Can anyone help?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
Integrations - webpack
This guide provides a high-level overview of how webpack can be integrated into some of the more popular task runners. NPM Scripts. Often...
Read more >Using with webpack - Jest
Jest can be used in projects that use webpack to manage assets, ... over other tools because it integrates directly with your application...
Read more >Integration with Webpack - Flexmonster
Integration with Webpack · Step 1. Create a new project based on the sample from GitHub · Step 2. Install npm packages ·...
Read more >Webpack Integration - CKEditor 4 Documentation
# Basic Webpack Integration · mkdir ckeditor4-webpack cd ckeditor4-webpack npm init -y · npm install --save-dev ckeditor4 webpack webpack-cli · 'use strict'; const ......
Read more >@sanity/webpack-integration - npm
Start using @sanity/webpack-integration in your project by running `npm i @sanity/webpack-integration`. There are 4 other projects in the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hanhanhan thanks for sharing the codesandboxes!
I managed to make the web-worker React example work by using a piece of code from here
Here is a working Codesandbox
@AdrianLsk thanks for figuring it out and introducing me to
Blob
andimportScripts
! Time for me to learn more about webworkers.