Skip to content
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
2 changes: 1 addition & 1 deletion src/content/api/module-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ import('./module-a').then((moduleA) => {

<Badge text="5.68.0+" />

It provides access to the the current `module`. `module` is not available in strict ESM.
It provides access to the current `module`. `module` is not available in strict ESM.

## \_\_webpack_module\_\_.id (webpack-specific)

Expand Down
2 changes: 1 addition & 1 deletion src/content/configuration/module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ module.exports = {
};
```

When used a a function, it executes for every module and must return a data URI string.
When used as a function, it executes for every module and must return a data URI string.

```js
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion src/content/guides/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Now, since we'll be bundling our scripts, we have to update our `index.html` fil
</html>
```

T> A couple other script loading strategies exist. Deferred loading is one such alternative to the above, where instead scripts are consolidated into the `<head>` and are given the `defer` attribute. This strategy downloads the external script resource(s) in parallel with document parsing, and will execute the scripts in order of document appearance after parsing has finished. This is in contrast to the above, in which the parser pauses to download and then execute the external resource syncronously. To learn more about this process, MDN has a nice [`reference guide`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script#async_and_defer).
T> A couple other script loading strategies exist. Deferred loading is one such alternative to the above, where instead scripts are consolidated into the `<head>` and are given the `defer` attribute. This strategy downloads the external script resource(s) in parallel with document parsing, and will execute the scripts in order of document appearance after parsing has finished. This is in contrast to the above, in which the parser pauses to download and then execute the external resource synchronously. To learn more about this process, MDN has a nice [`reference guide`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script#async_and_defer).

In this setup, `index.js` explicitly requires `lodash` to be present, and binds it as `_` (no global scope pollution). By stating what dependencies a module needs, webpack can use this information to build a dependency graph. It then uses the graph to generate an optimized bundle where scripts will be executed in the correct order.

Expand Down
Loading