create-react-library icon indicating copy to clipboard operation
create-react-library copied to clipboard

Problem with images for the example project

Open diamondfish opened this issue 4 years ago • 0 comments

Since CRA was updated to use the new module-system for image imports, we've updated all imported images to use the new ".default"-property to get the url:

import image from 'assets/file.png';
const url = image.default;

When importing the built library into other projects, it works fine. But, I can't get the example project to run properly. The package.json for the library uses an old react-scripts version. How can I make the example project run smoothly and use the new image modules-feature in webpack to work properly with my updated library?

Or what I guess I'm asking is, how can I update the example project to be an updated version of CRA?

diamondfish avatar Jan 18 '21 16:01 diamondfish