Skip to content

Commit

Permalink
docs: fix modules docs crash (#6449)
Browse files Browse the repository at this point in the history
fix: modules docs
  • Loading branch information
SyMind authored May 6, 2024
1 parent 3a7e6e7 commit 7c68f97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion website/docs/en/api/modules/module-methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This feature relies on `Promise` internally. If you use import() with older brow
It is not possible to use a fully dynamic import statement, such as `import(foo)`. Because `foo` could potentially be any path to any file in your system or project.

The `import()` must contain at least some information about where the module is located. Bundling can be limited to a specific directory or set of files so that when you are using a dynamic expression - every module that could potentially be requested on an `import()` call is included.
For example, `import(`./locale/${language}.json`)` will cause every `.json` file in the `./locale` directory to be bundled into the new chunk. At run time, when the variable `language` has been computed, any file like `english.json` or `german.json` will be available for consumption.
For example, `import(`./locale/$\{language}.json`)` will cause every `.json` file in the `./locale` directory to be bundled into the new chunk. At run time, when the variable `language` has been computed, any file like `english.json` or `german.json` will be available for consumption.

```js
// imagine we had a method to get language from cookies or other storage
Expand Down
5 changes: 5 additions & 0 deletions website/docs/en/api/modules/module-variables.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import WebpackLicense from '@components/webpack-license';
import { ApiMeta } from '../../../../components/ApiMeta';

<WebpackLicense from="https://webpack.docschina.org/api/module-variables/" />

# Module Variables

This section covers all **variables** available in code compiled with webpack. Modules will have access to certain data from the compilation process through `module` and other variables.
Expand Down

0 comments on commit 7c68f97

Please sign in to comment.