-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draft: move all build constants for bundlers instead of babel #34277
Conversation
// Therefore, all conditions set by ESM will also hold for SxG. | ||
// However, we will also need to introduce a separate IS_SxG flag | ||
// for conditions only true for SxG. | ||
const replacements = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-review: figure out the rest of the experiments
* Build Constants -- see build-system/build-constants.js for definition. | ||
*/ | ||
/** @define {boolean} */ | ||
var IS_FORTESTING = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's maybe split these out and stick em in something like compiler-constants.extern.js
or something similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this ever works...sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I've extracted the "combine all into one" element into: #34327
Closing because closure compiler does not support replacements within esm :( |
summary
We have a number of build-time constants that are all replaced by babel. Bundlers/compilers are actually a more natural time to perform this substitution. In fact, both
esbuild
andclosure
support it out of the box.