From 7c68f971ee98585e9c7a7ef11ff37ebfb555bc1e Mon Sep 17 00:00:00 2001 From: Cong-Cong Pan Date: Mon, 6 May 2024 20:10:42 +0800 Subject: [PATCH] docs: fix modules docs crash (#6449) fix: modules docs --- website/docs/en/api/modules/module-methods.mdx | 2 +- website/docs/en/api/modules/module-variables.mdx | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/website/docs/en/api/modules/module-methods.mdx b/website/docs/en/api/modules/module-methods.mdx index 61c39a110c2..c5c07e4ce12 100644 --- a/website/docs/en/api/modules/module-methods.mdx +++ b/website/docs/en/api/modules/module-methods.mdx @@ -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 diff --git a/website/docs/en/api/modules/module-variables.mdx b/website/docs/en/api/modules/module-variables.mdx index 6db7d32f195..ee87d37be65 100644 --- a/website/docs/en/api/modules/module-variables.mdx +++ b/website/docs/en/api/modules/module-variables.mdx @@ -1,3 +1,8 @@ +import WebpackLicense from '@components/webpack-license'; +import { ApiMeta } from '../../../../components/ApiMeta'; + + + # 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.