1

I'm trying to migrate some of my atmosphere packages to npm packages and ran into some issues with images not loading in the npm package uploadcare-widget. The package references images in the folder node_modules/uploadcare-widget/images. The images are displayed on the page via css, for example:

.uploadcare-dialog-file-sources:before {
  background-image: url("node_modules/uploadcare-widget/images/arrow.png");
}

I can see my app attempts to load the images from the network inspector, but the image doesn't load from the displayed path. I can confirm that image files are in the specified file directory. Is there something special I need to do to be able to load images from an npm package?

I tried import 'node_modules/uploadcare-widget/images'; and other variations inside the public folder. I'll probably end up going back to using an atmosphere package :\

Bradley
  • 2,379
  • 1
  • 11
  • 17
  • At the moment, you will probably need to copy them to the `public` folder. Note that the `public/` folder maps to the root, sot `public/foo.png` should be referred to as `/foo.png`. – MasterAM Jun 01 '16 at 18:07

1 Answers1

1

Probably, you use UPLOADCARE_SCRIPT_BASE like in readme, but maybe its wrong way.

Try to use just this code

import uploadcare from 'uploadcare-widget'

instead readme-like code.

Zmoki
  • 71
  • 2