react / react/metro

Metro bundler doesn't include source map for dependency packages

Open
#524 3 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.6k
Forks
696
Avg merge
8m
Merged PRs (30d)
7

Description

I am setting up JS monorepo which consists of two packages, A and B. The code is in TypeScript. It uses yarn and lerna.

A is a JS library package. B is a react native test app which consumes library. B uses the metro bundler to produce the bundle. I want to include source map in the bundle, hence I'm setting the sourceMap parameter to true.

I found that the bundle only contains the source map data for files in B, but not in A. How can I configure the Metro bundler to also include source map for dependency package A?

The Metro bundler that I'm using is from react-native 0.60.

Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported setup with Metro, React Native 0.60, Yarn, Lerna, and the sourceMap option enabled for package B consuming package A. Trace how Metro handles source maps for dependency packages; done means the generated bundle includes source-map data for both B and A.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.