chore: fix examples#20780
Conversation
|
|
This PR is packaged and the instant preview is available (47bb540). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@47bb540
yarn add -D webpack@https://pkg.pr.new/webpack@47bb540
pnpm add -D webpack@https://pkg.pr.new/webpack@47bb540 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20780 +/- ##
=======================================
Coverage 91.42% 91.42%
=======================================
Files 559 559
Lines 55150 55150
Branches 14556 14556
=======================================
Hits 50423 50423
Misses 4727 4727
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refreshes a large set of example READMEs to match regenerated webpack output, and fixes how the examples’ README regeneration script toggles CLI args via global flags.
Changes:
- Regenerated many example README snippets (updated webpack bootstrap/runtime fragments, asset size lines, and stats output).
- Updated
examples/build-common.jsto correctly honor global flags likeNO_TARGET_ARGS,NO_REASONS, andNO_STATS_OPTIONSwhen assembling webpack CLI arguments. - Adjusted the
custom-javascript-parserexample config/README output (but currently leaves the exported config without anentry).
Reviewed changes
Copilot reviewed 68 out of 68 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| examples/worker/README.md | Update embedded webpack bootstrap snippet and asset-size lines. |
| examples/wasm-simple/README.md | Update embedded webpack bootstrap snippet. |
| examples/wasm-complex/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/wasm-bindgen-esm/README.md | Update embedded webpack bootstrap snippet. |
| examples/virtual-modules/README.md | Reformat VirtualUrlPlugin example and refresh embedded output/runtime snippets. |
| examples/typescript/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/two-explicit-vendor-chunks/README.md | Update embedded webpack bootstrap snippets and asset-size block. |
| examples/top-level-await/README.md | Update embedded webpack bootstrap snippet. |
| examples/stats-detailed/README.md | Refresh example compilation hash line. |
| examples/source-mapping-url/README.md | Update embedded webpack bootstrap snippet and source map JSON/output lines. |
| examples/source-map/README.md | Refresh emitted asset-size lines across multiple output variants. |
| examples/side-effects/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/scope-hoisting/README.md | Update embedded webpack bootstrap snippet. |
| examples/require.resolve/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/require.context/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/reexport-components/README.md | Refresh production asset-size line. |
| examples/persistent-caching/README.md | Refresh asset-size and warning blocks to match regenerated output. |
| examples/nodejs-addons/README.md | Refresh emitted asset hash/name lines and asset-size lines. |
| examples/named-chunks/README.md | Update embedded webpack bootstrap snippet. |
| examples/multiple-entry-points/README.md | Update embedded webpack bootstrap snippets and asset-size lines. |
| examples/multi-part-library/README.md | Update embedded webpack bootstrap snippets and asset-size lines. |
| examples/multi-compiler/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/module/README.md | Refresh embedded ESM output snippet and asset-size line. |
| examples/module-worker/README.md | Update multiple embedded webpack bootstrap snippets and asset-size lines. |
| examples/module-federation/README.md | Update embedded webpack bootstrap snippets and reorder one stats line. |
| examples/module-code-splitting/README.md | Update embedded webpack bootstrap snippet and asset-size line(s). |
| examples/mixed/README.md | Update embedded webpack bootstrap snippet. |
| examples/markdown/README.md | Refresh embedded output, including runtime/to-binary snippet and asset-size blocks. |
| examples/loader/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/hybrid-routing/README.md | Update async context snippet (try/catch) and embedded webpack bootstrap snippet; refresh asset-size lines. |
| examples/http2-aggressive-splitting/README.md | Refresh emitted chunk hash filenames and related asset lines. |
| examples/harmony/README.md | Update embedded webpack bootstrap snippet. |
| examples/harmony-unused/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/harmony-interop/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/extra-async-chunk/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/extra-async-chunk-advanced/README.md | Update embedded webpack bootstrap snippet. |
| examples/externals/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/explicit-vendor-chunk/README.md | Refresh vendor global symbol name and embedded output/bootstrap snippets. |
| examples/dll/README.md | Refresh dll global symbol name, manifest JSON, and embedded output/bootstrap snippet. |
| examples/dll-user/README.md | Refresh dll-reference external names and embedded webpack bootstrap snippet. |
| examples/dll-entry-only/README.md | Refresh dll global symbol name, manifest JSON, embedded bootstrap, and asset-size line. |
| examples/dll-app-and-vendor/1-app/README.md | Refresh vendor dll-reference external names and embedded bootstrap snippet; refresh asset-size lines. |
| examples/dll-app-and-vendor/0-vendor/README.md | Refresh vendor dll global name/manifest and embedded bootstrap snippet; refresh asset-size line. |
| examples/custom-json-modules/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/custom-javascript-parser/webpack.config.js | Removed entry fields from each config in the exported config array. |
| examples/custom-javascript-parser/README.md | Updated embedded config snippet (now missing entry) and refreshed stats/output blocks. |
| examples/css/README.md | Refreshed embedded dist/output.js snippet and runtime snippet; updated output asset lines. |
| examples/commonjs/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/common-chunk-grandchildren/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/common-chunk-and-vendor-chunk/README.md | Update multiple embedded webpack bootstrap snippets and refresh asset-size block. |
| examples/coffee-script/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/code-splitting/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/code-splitting-specify-chunk-name/README.md | Update async context snippet (try/catch), embedded bootstrap snippet, and asset-size lines. |
| examples/code-splitting-native-import-context/README.md | Update async context snippet (try/catch), embedded bootstrap snippet, and asset-size lines. |
| examples/code-splitting-native-import-context-filter/README.md | Update async context snippet (try/catch), embedded bootstrap snippet, and asset-size lines. |
| examples/code-splitting-harmony/README.md | Update async context snippet (try/catch), embedded bootstrap snippet, and asset-size lines. |
| examples/code-splitting-depend-on-simple/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/code-splitting-depend-on-advanced/README.md | Update embedded webpack bootstrap snippet and refresh asset-size lines. |
| examples/code-splitting-bundle-loader/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/code-splitted-require.context/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/code-splitted-require.context-amd/README.md | Update embedded webpack bootstrap snippet and asset-size line. |
| examples/cjs-tree-shaking/README.md | Refresh stats output format to include chunk/entry metadata. |
| examples/chunkhash/README.md | Update embedded webpack bootstrap snippet. |
| examples/build-http/README.md | Refresh asset-size line. |
| examples/build-common.js | Fix flag handling for CLI args used when regenerating README outputs. |
| examples/asset/README.md | Refresh embedded output (asset module headers + runtime/to-binary snippet). |
| examples/asset-svg-data-uri/README.md | Refresh embedded output (asset module header + bootstrap) and asset-size line. |
| examples/aggressive-merging/README.md | Refresh asset-size lines. |
Comments suppressed due to low confidence (2)
examples/custom-javascript-parser/webpack.config.js:18
webpack.config.jsnow exports a configuration array with noentryfor any compiler. Webpack requires an entry point, so running this example viawebpack --config webpack.config.jswill fail unless callers always provide--entryon the CLI. Consider restoringentry: './example.js'(or setting a sharedentryvariable) and, if the README build pipeline needs CLI-provided entry/output, updatebuild.jsto setglobal.NO_TARGET_ARGS = truefor this example to avoid overriding the per-compileroutput.filenamesettings.
/** @type {import("webpack").Configuration[]} */
const config = [
// oxc
{
mode: "production",
optimization: {
chunkIds: "deterministic" // To keep filename consistent between different modes (for example building only)
},
output: {
filename: "oxc.[name].js"
},
module: {
examples/custom-javascript-parser/README.md:401
- The README’s embedded
Configuration examplenow shows configs without anentry, which makes the example config incomplete unless users pass--entryon the CLI. Additionally, theInfosection shows assets namedoutput.js, which conflicts with theoutput.filenamevalues shown in the config snippet, making the documentation internally inconsistent. Once the config/build setup is corrected, please regenerate this README section so the shown output matches the configuration.
/** @type {import("webpack").Configuration[]} */
const config = [
// oxc
{
mode: "production",
optimization: {
chunkIds: "deterministic" // To keep filename consistent between different modes (for example building only)
},
output: {
filename: "oxc.[name].js"
},
module: {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this PR will improve performance by 33.79%
Performance Changes
Comparing |
Summary
chore - fix examples
What kind of change does this PR introduce?
build
Did you add tests for your changes?
no need
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Nothing
Use of AI
No