egoist / egoist/tsup

Bundling Assets for React Native component

Open
#1,097 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

Hi, I am using tsup to build a react native component. Everything works fine, except Images. While developing I can use images and render them into the Image component.

import logo from '../assets/images/logo.png' when running the library as a standalone but once bundled using tsup and added to another project, the the image no longer loads correctly

I tried with --publicDir to copy all my assets into dist but still is not working.

Any advice? Thanks

cc @egoist

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the React Native component build with tsup and --publicDir, then inspect how the bundled package references the imported image. Done means the image loads correctly when the bundled package is consumed by another project.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
build-system, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.