Skip to content

@W-22185056: Add BUILD_VARIANT concept with single "default" variant#327

Open
anyoung-tableau wants to merge 3 commits intoanyoung/tools-web-folderfrom
anyoung/build-variant
Open

@W-22185056: Add BUILD_VARIANT concept with single "default" variant#327
anyoung-tableau wants to merge 3 commits intoanyoung/tools-web-folderfrom
anyoung/build-variant

Conversation

@anyoung-tableau
Copy link
Copy Markdown
Collaborator

@anyoung-tableau anyoung-tableau commented Apr 22, 2026

These changes introduce the concept of build variants which serve 2 purposes:

  1. Allow for easily creating new customizable build output artifacts. Examples: @W-22188550: Add "desktop" build variant #330 and @W-22188766: Add "combined" build variant #331
  2. Allow for build-time static replacement using esbuild's define concept.

@anyoung-tableau anyoung-tableau marked this pull request as ready for review April 23, 2026 21:21
Comment thread src/scripts/build.ts
outfile: './build/index.js',
});
// https://esbuild.github.io/api/#define
define: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Design Q: do we want BUILD_VARIANT to be runtime-readable outside the variant entry points at all?

The entry-point swap already gives us a clean build boundary, and exposing import.meta.env.BUILD_VARIANT more broadly seems like it could invite shared modules to grow variant conditionals over time

Keep variant selection constrained to the entry/build layer unless a concrete use case shows up?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good callout. I tried to get stuff working without using define at all, but it got kinda messy. Let me give it another shot.

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