Skip to content

Suppress webpack warnings in example and devtools builds#26545

Open
frankmueller-msft wants to merge 1 commit intomicrosoft:mainfrom
frankmueller-msft:fix/suppress-webpack-example-warnings
Open

Suppress webpack warnings in example and devtools builds#26545
frankmueller-msft wants to merge 1 commit intomicrosoft:mainfrom
frankmueller-msft:fix/suppress-webpack-example-warnings

Conversation

@frankmueller-msft
Copy link
Contributor

@frankmueller-msft frankmueller-msft commented Feb 25, 2026

Summary

  • shared-tree-demo: Adds performance: { hints: false } to suppress webpack's default 244 KiB asset/entrypoint size warnings (not actionable for an example app). Adds silent: Boolean(process.env.CI || process.env.TF_BUILD) to dotenv-webpack so the missing .env warning is suppressed in CI but preserved locally for developers.
  • devtools-browser-extension: Same conditional silent flag on dotenv-webpack.

Together these eliminate ~4 warnings per build.

Test plan

  • Build - client packages pipeline passes (build, policy checks, all test stages)
  • repo-policy-check passes
  • Verify CI build logs no longer show asset size or .env warnings for these packages

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 25, 2026 21:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces webpack noise in CI/dev builds by suppressing expected warnings in an example app and the devtools browser extension build configurations.

Changes:

  • Add silent: true to dotenv-webpack usage to suppress missing .env warnings.
  • Disable webpack performance size hints in shared-tree-demo to avoid default asset/entrypoint size warnings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/tools/devtools/devtools-browser-extension/webpack.config.cjs Suppresses dotenv-webpack missing .env warning via silent: true.
examples/service-clients/odsp-client/shared-tree-demo/webpack.config.cjs Suppresses dotenv-webpack missing .env warning and disables webpack performance hints.
Comments suppressed due to low confidence (1)

examples/service-clients/odsp-client/shared-tree-demo/webpack.config.cjs:71

  • Setting performance.hints = false disables all webpack performance hints. If the intent is just to avoid the default ~244KiB warning for this example, consider instead raising maxAssetSize / maxEntrypointSize to an expected upper bound so truly unexpected bundle growth still produces a warning.
		// This is an example app — disable webpack's default 244 KiB asset/entrypoint size warnings.
		performance: {
			hints: false,
		},

}),
new Dotenv({
systemvars: true,
silent: true,
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

silent: true will suppress the warning that the README relies on to prompt users to copy .env.template to .env. Consider making silent conditional (e.g., only in CI) so local devs still get an explicit signal when .env is missing.

Suggested change
silent: true,
// Show warnings locally to prompt copying `.env.template` to `.env`,
// but stay silent in CI environments where CI logs should be quieter.
silent: Boolean(process.env.CI),

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed — now uses silent: Boolean(process.env.CI || process.env.TF_BUILD) so local devs still see the warning.

new Dotenv({
path: "./.env",
systemvars: true,
silent: true,
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

silent: true will also suppress the helpful warning when a developer forgets to create the local .env file. Since this config is used for local development as well as CI, consider making silent conditional (e.g., only in CI) so missing .env is still surfaced locally.

Suggested change
silent: true,
silent: Boolean(process.env.CI),

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed — same conditional silent: Boolean(process.env.CI || process.env.TF_BUILD) applied here.

Add conditional silent flag to dotenv-webpack (only in CI via
process.env.CI || process.env.TF_BUILD) so missing .env warnings are
suppressed in pipelines but preserved for local development. Disable
webpack performance hints in the shared-tree-demo example app where
bundle size warnings are not actionable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@frankmueller-msft frankmueller-msft force-pushed the fix/suppress-webpack-example-warnings branch from fbca870 to 4ffc80c Compare February 26, 2026 00:12
Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

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

Seems fine to me. Left one suggestion below.

For reference, this is how logs look like without the change (devtools one further down), and in the corresponding logs for this PR run no more warnings show up in for shared-tree-demo nor devtools.

silent: Boolean(process.env.CI || process.env.TF_BUILD),
}),
],
// This is an example app — disable webpack's default 244 KiB asset/entrypoint size warnings.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// This is an example app — disable webpack's default 244 KiB asset/entrypoint size warnings.
// This is an example app — disable webpack's default 244 KiB asset/entrypoint size warnings to keep webpack output cleaner (we don't need to address this for a sample app)

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.

3 participants