Suppress webpack warnings in example and devtools builds#26545
Suppress webpack warnings in example and devtools builds#26545frankmueller-msft wants to merge 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
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: truetodotenv-webpackusage to suppress missing.envwarnings. - Disable webpack performance size hints in
shared-tree-demoto 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 = falsedisables all webpack performance hints. If the intent is just to avoid the default ~244KiB warning for this example, consider instead raisingmaxAssetSize/maxEntrypointSizeto 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, |
There was a problem hiding this comment.
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.
| 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), |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
| silent: true, | |
| silent: Boolean(process.env.CI), |
There was a problem hiding this comment.
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>
fbca870 to
4ffc80c
Compare
alexvy86
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
| // 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) |
Summary
performance: { hints: false }to suppress webpack's default 244 KiB asset/entrypoint size warnings (not actionable for an example app). Addssilent: Boolean(process.env.CI || process.env.TF_BUILD)to dotenv-webpack so the missing.envwarning is suppressed in CI but preserved locally for developers.silentflag on dotenv-webpack.Together these eliminate ~4 warnings per build.
Test plan
Build - client packagespipeline passes (build, policy checks, all test stages).envwarnings for these packages🤖 Generated with Claude Code