Skip to content

docs: update examples #19778

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
docs: update examples
  • Loading branch information
alexander-akait authored and github-actions[bot] committed Aug 10, 2025
commit bc78733253bc12f8d29df1bc3a9f11a9a315f99d
56 changes: 52 additions & 4 deletions examples/module-library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,50 @@ export function reset() {
# dist/output.js

```javascript
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
```

<details><summary><code>/* webpack runtime code */</code></summary>

``` js
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
```

</details>

``` js
var __webpack_exports__ = {};
/*!********************************!*\
!*** ./example.js + 2 modules ***!
\********************************/
Expand All @@ -42,7 +86,9 @@ export function reset() {
/*! export resetCounter [provided] [used in main] [missing usage info prevents renaming] -> ./counter.js .reset */
/*! export value [provided] [used in main] [missing usage info prevents renaming] -> ./counter.js .value */
/*! other exports [not provided] [no usage info] */
/*! runtime requirements: */
/*! runtime requirements: __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

;// ./counter.js
let value = 0;
Expand Down Expand Up @@ -79,9 +125,10 @@ let n=0;function o(){n++}function t(){n--}function e(){n=0}const s=n=>console.lo
## Unoptimized

```
asset output.js 1.19 KiB [emitted] [javascript module] (name: main)
chunk (runtime: main) output.js (main) 302 bytes [entry] [rendered]
asset output.js 2.69 KiB [emitted] [javascript module] (name: main)
chunk (runtime: main) output.js (main) 302 bytes (javascript) 670 bytes (runtime) [entry] [rendered]
> ./example.js main
runtime modules 670 bytes 3 modules
./example.js + 2 modules 302 bytes [built] [code generated]
[exports: decrement, increment, print, reset, resetCounter, value]
[used exports unknown]
Expand All @@ -94,8 +141,9 @@ webpack X.X.X compiled successfully

```
asset output.js 174 bytes [emitted] [javascript module] [minimized] (name: main)
chunk (runtime: main) output.js (main) 302 bytes [entry] [rendered]
chunk (runtime: main) output.js (main) 302 bytes (javascript) 396 bytes (runtime) [entry] [rendered]
> ./example.js main
runtime modules 396 bytes 2 modules
./example.js + 2 modules 302 bytes [built] [code generated]
[exports: decrement, increment, print, reset, resetCounter, value]
[all exports used]
Expand Down
43 changes: 39 additions & 4 deletions examples/module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,46 @@ export function reset() {
# dist/output.js

```javascript
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
```

<details><summary><code>/* webpack runtime code */</code></summary>

``` js
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
```

</details>

``` js
var __webpack_exports__ = {};
/*!********************************!*\
!*** ./example.js + 2 modules ***!
\********************************/
/*! namespace exports */
/*! export inc [provided] [used in main] [could be renamed] -> ./counter.js .increment */
/*! export print [provided] [used in main] [could be renamed] -> ./methods.js .print */
/*! runtime requirements: */
/*! runtime requirements: __webpack_exports__, __webpack_require__.d, __webpack_require__.* */

;// ./counter.js
let value = 0;
Expand Down Expand Up @@ -92,9 +125,10 @@ let o=0;function n(){o++}const c=o=>console.log(o);c(o),n(),n(),n(),c(o),o=0,c(o
## Unoptimized

```
asset output.js 710 bytes [emitted] [javascript module] (name: main)
chunk (runtime: main) output.js (main) 453 bytes [entry] [rendered]
asset output.js 1.68 KiB [emitted] [javascript module] (name: main)
chunk (runtime: main) output.js (main) 453 bytes (javascript) 396 bytes (runtime) [entry] [rendered]
> ./example.js main
runtime modules 396 bytes 2 modules
./example.js + 2 modules 453 bytes [built] [code generated]
[exports: inc, print]
[all exports used]
Expand All @@ -107,8 +141,9 @@ webpack X.X.X compiled successfully

```
asset output.js 110 bytes [emitted] [javascript module] [minimized] (name: main)
chunk (runtime: main) output.js (main) 453 bytes [entry] [rendered]
chunk (runtime: main) output.js (main) 453 bytes (javascript) 396 bytes (runtime) [entry] [rendered]
> ./example.js main
runtime modules 396 bytes 2 modules
./example.js + 2 modules 453 bytes [built] [code generated]
[exports: inc, print]
[all exports used]
Expand Down
Loading