Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it with vite #63

Open
bjhuang103 opened this issue Mar 25, 2023 · 1 comment
Open

How to use it with vite #63

bjhuang103 opened this issue Mar 25, 2023 · 1 comment

Comments

@bjhuang103
Copy link

bjhuang103 commented Mar 25, 2023

I try to use it with vue + vite, But it have some problem when I build it.

node_modules/vite/node_modules/esbuild/lib/main.js:1336:21: ERROR: [plugin: vite:dep-scan] Failed to resolve entry for package "@cornerstonejs/nifti-image-loader". The package may have incorrect main/module/exports specified in its package.json.
@iamiota
Copy link

iamiota commented Apr 7, 2023

Add alias for it in vite.config.ts

export default defineConfig({
  resolve: {
    alias: {
      'cornerstone-nifti-image-loader': '@cornerstonejs/nifti-image-loader/dist/cornerstoneNIFTIImageLoader.min.js',
    },
  },
})

Use it with alias

import * as cornerstoneNIFTIImageLoader from 'cornerstone-nifti-image-loader'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants