mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
This PR implements native Windows resource editing in Zig, replacing the previous rescle C++ implementation. Users can now customize Windows executables when using 'bun build --compile' with the following new options: - --windows-icon <path> Set custom executable icon - --windows-title <str> Set executable title/product name - --windows-publisher <str> Set company/publisher name - --windows-version <str> Set version (e.g. "1.2.3.4") - --windows-description <str> Set executable description - --windows-hide-console Hide console window (already existed) Example: ```bash bun build --compile \ --target=bun-windows-x64 \ --windows-icon=app.ico \ --windows-title="My Application" \ --windows-publisher="My Company" \ --windows-version="2.1.0.0" \ --windows-description="A powerful application built with Bun" \ index.ts ``` Implementation details: - Pure Zig implementation in windows_resources.zig - Removes C++ rescle dependency - Creates WindowsSettings struct to organize all Windows options - Supports cross-platform compilation (build Windows exe from Linux/macOS) - Fixed alignment issues using safe memory operations - Comprehensive test coverage in test/bundler/windows-resources-compile.test.ts This allows full customization of Windows executable metadata without external dependencies. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>