-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(esbuild): make Starlark build settings usable as defines (#3122)
Adds a `define_settings` attribute to the `esbuild` rules that allows using the values of Starlark build settings to globally replace specified identifiers. The value of the setting is automatically converted to a JS literal. Note: This currently uses json.encode, which is only available from Bazel 5 on. If this addition is generally viewed favorably, I would look into "polyfilling" this functionality in Starlark.
- Loading branch information
Showing
7 changed files
with
102 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
declare const BUILD_SCM_VERSION: string; | ||
declare const SOME_TEST_ENV: string; | ||
declare const SOME_BOOL_FLAG_VALUE: boolean; | ||
declare const SOME_STRING_FLAG_VALUE: string; | ||
|
||
export const nodeEnv = process.env.NODE_ENV; | ||
export const version = BUILD_SCM_VERSION; | ||
export const env = SOME_TEST_ENV; | ||
export const someBoolFlag = SOME_BOOL_FLAG_VALUE; | ||
export const someStringFlag = SOME_STRING_FLAG_VALUE; | ||
|
||
console.log(process.cwd()); | ||
console.log(process.cwd()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters