Skip to content

build: look for the proper export fields for jsonc-parser in esbuilds #2948

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

Merged
merged 1 commit into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,741 changes: 3,225 additions & 2,516 deletions .github/local-actions/branch-manager/main.js

Large diffs are not rendered by default.

3,991 changes: 2,001 additions & 1,990 deletions .github/local-actions/labels-sync/main.js

Large diffs are not rendered by default.

3,991 changes: 2,001 additions & 1,990 deletions .github/local-actions/lock-closed/main.js

Large diffs are not rendered by default.

3,991 changes: 2,001 additions & 1,990 deletions github-actions/branch-manager/main.js

Large diffs are not rendered by default.

3,995 changes: 2,003 additions & 1,992 deletions github-actions/feature-request/main.js

Large diffs are not rendered by default.

4,804 changes: 2,782 additions & 2,022 deletions github-actions/google-internal-tests/main.js

Large diffs are not rendered by default.

3,991 changes: 2,001 additions & 1,990 deletions github-actions/org-file-sync/main.js

Large diffs are not rendered by default.

3,993 changes: 2,002 additions & 1,991 deletions github-actions/post-approval-changes/main.js

Large diffs are not rendered by default.

4,007 changes: 2,009 additions & 1,998 deletions github-actions/pull-request-labeling/main.js

Large diffs are not rendered by default.

4,212 changes: 2,087 additions & 2,125 deletions github-actions/unified-status-check/main.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion tools/defaults2.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,16 @@ def esbuild_checked_in(name, platform = None, config = {}, **kwargs):
"""

# Define a default configuration for the Node.js platform.
# This adds a 'require' shim needed by esbuild for ES Modules.
# This adds a 'require' shim needed by esbuild for ES Modules and updates the main Fields to
# properly bundle jsonc-parser.
node_defaults = {
"banner": {
"js": "import { createRequire } from 'node:module';globalThis['require'] ??= createRequire(import.meta.url);",
},
"mainFields": [
"module",
"main",
],
}

# If the platform is "node", merge the user's config on top of the defaults.
Expand Down