Skip to content

Conversation

@remorses
Copy link
Contributor

@remorses remorses commented Dec 14, 2025

Build scripts were manually listing dependencies to externalize, but core was missing regular dependencies (only had optionalDependencies and peerDependencies). This caused deps like yoga-layout, diff, jimp, and bun-ffi-structs to be bundled into dist.

Switched all packages to use Bun's packages: "external" option which automatically externalizes all npm imports.

Tested compiling examples to standalone binaries with bun build --compile - yoga-layout WASM and other dependencies are still bundled correctly by Bun at compile time.

Copilot AI review requested due to automatic review settings December 14, 2025 12:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the build scripts across all packages to use Bun's packages: "external" option instead of manually listing dependencies to externalize. The primary motivation was fixing a bug in the core package where regular dependencies (yoga-layout, diff, jimp, bun-ffi-structs) were being bundled because the old code only externalized optionalDependencies and peerDependencies.

Key changes:

  • Removed manual dependency listing code that gathered dependencies from package.json
  • Switched to Bun's packages: "external" option for automatic npm dependency externalization
  • Retained special external patterns in core package for non-npm files (WASM, SCM files)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/vue/scripts/build.ts Removed manual dependency collection and switched to packages: "external"
packages/solid/scripts/build.ts Removed manual dependency collection and switched to packages: "external"
packages/react/scripts/build.ts Removed manual dependency collection and switched to packages: "external" for all three build targets
packages/core/scripts/build.ts Removed manual dependency collection, added --packages=external CLI flag, and updated comments while preserving special external patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kommander
Copy link
Collaborator

Need to run some tests first with opencode builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants