Skip to content

Add --prepack flag to build script#55415

Closed
huntie wants to merge 1 commit intofacebook:mainfrom
huntie:export-D92395174
Closed

Add --prepack flag to build script#55415
huntie wants to merge 1 commit intofacebook:mainfrom
huntie:export-D92395174

Conversation

@huntie
Copy link
Copy Markdown
Member

@huntie huntie commented Feb 5, 2026

Summary:
Add optional flag to JS build setup that includes running the "prepack" script step after build — allowing the net behaviour before #54857 to be conveninently switched to if needed.

This is motivated by fixing our internal CI action for xplat/js/react-native-github/scripts/debugger-shell/build-binary.js — which depends on a locally built + package.json-written package state (the latter of which no longer happened for yarn build by default).

Changelog: [Internal]

Differential Revision: D92395174

Summary:
Add optional flag to JS build setup that includes running the `"prepack"` script step after build — allowing the net behaviour before facebook#54857 to be conveninently switched to if needed.

This is motivated by fixing our internal CI action for `xplat/js/react-native-github/scripts/debugger-shell/build-binary.js` — which depends on a locally built + package.json-written package state (the latter of which no longer happened for `yarn build` by default).

Changelog: [Internal]

Differential Revision: D92395174
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 5, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Feb 5, 2026

@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92395174.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @huntie in 141e021

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Feb 5, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Feb 5, 2026

This pull request has been merged in 141e021.

@huntie huntie deleted the export-D92395174 branch February 5, 2026 16:12
fabriziocucci added a commit to fabriziocucci/react-native that referenced this pull request Mar 9, 2026
Summary:
Changelog: [Internal]

The build_debugger_shell CI job was failing because build-binary.js
expects pkg.main to start with ./dist/, but without --prepack the
prepack.js script never runs, so main stays as ./src/index.js.

This was caused by a series of PRs:
- PR facebook#54857 refactored debugger-shell/package.json to use the
  publishConfig pattern, moving main from ./dist/index.js to
  ./src/index.js.
- PR facebook#55415 added the --prepack flag to build.js to support this.
- PR facebook#55416 added the build_debugger_shell CI job but ran yarn build
  without --prepack.

The fix passes --prepack to yarn build so that prepack.js rewrites
package.json main to ./dist/index.js before build-binary.js runs.

Reviewed By: huntie

Differential Revision: D95818417
meta-codesync bot pushed a commit that referenced this pull request Mar 9, 2026
Summary:
Pull Request resolved: #56005

Changelog: [Internal]

The build_debugger_shell CI job was failing because build-binary.js
expects pkg.main to start with ./dist/, but without --prepack the
prepack.js script never runs, so main stays as ./src/index.js.

This was caused by a series of PRs:
- PR #54857 refactored debugger-shell/package.json to use the
  publishConfig pattern, moving main from ./dist/index.js to
  ./src/index.js.
- PR #55415 added the --prepack flag to build.js to support this.
- PR #55416 added the build_debugger_shell CI job but ran yarn build
  without --prepack.

The fix passes --prepack to yarn build so that prepack.js rewrites
package.json main to ./dist/index.js before build-binary.js runs.

Reviewed By: huntie

Differential Revision: D95818417

fbshipit-source-id: 03c8340c415960c3937b13bdea3952798d2d420e
fabriziocucci added a commit that referenced this pull request Mar 9, 2026
Summary:
Pull Request resolved: #56005

Changelog: [Internal]

The build_debugger_shell CI job was failing because build-binary.js
expects pkg.main to start with ./dist/, but without --prepack the
prepack.js script never runs, so main stays as ./src/index.js.

This was caused by a series of PRs:
- PR #54857 refactored debugger-shell/package.json to use the
  publishConfig pattern, moving main from ./dist/index.js to
  ./src/index.js.
- PR #55415 added the --prepack flag to build.js to support this.
- PR #55416 added the build_debugger_shell CI job but ran yarn build
  without --prepack.

The fix passes --prepack to yarn build so that prepack.js rewrites
package.json main to ./dist/index.js before build-binary.js runs.

Reviewed By: huntie

Differential Revision: D95818417

fbshipit-source-id: 03c8340c415960c3937b13bdea3952798d2d420e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants