From 342b21def1b46e3dfecda05a5e5edd8027071d4f Mon Sep 17 00:00:00 2001 From: Ahn <27772165+ahnpnl@users.noreply.github.com> Date: Wed, 11 May 2022 23:46:01 +0200 Subject: [PATCH] docs(devs-infra): update ESM doc (#1468) --- website/docs/guides/esm-support.md | 22 +++++++++---------- .../version-10.x/guides/esm-support.md | 22 +++++++++---------- .../version-11.0/guides/esm-support.md | 22 +++++++++---------- .../version-11.1/guides/esm-support.md | 22 +++++++++---------- .../version-12.0/guides/esm-support.md | 22 +++++++++---------- .../version-9.x/guides/esm-support.md | 22 +++++++++---------- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/website/docs/guides/esm-support.md b/website/docs/guides/esm-support.md index db0aacb55e..384ab6e39c 100644 --- a/website/docs/guides/esm-support.md +++ b/website/docs/guides/esm-support.md @@ -59,6 +59,17 @@ module.exports = { #### Use ESM presets +:::tip + +Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. +However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded +correctly. + +To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a +custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). + +::: + ```js // jest.config.js module.exports = { @@ -76,14 +87,3 @@ module.exports = { } } ``` - -:::tip - -Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. -However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded -correctly. - -To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a -custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). - -::: diff --git a/website/versioned_docs/version-10.x/guides/esm-support.md b/website/versioned_docs/version-10.x/guides/esm-support.md index 8cf46020ba..04a26879c3 100644 --- a/website/versioned_docs/version-10.x/guides/esm-support.md +++ b/website/versioned_docs/version-10.x/guides/esm-support.md @@ -47,6 +47,17 @@ module.exports = { #### Use ESM presets +:::tip + +Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. +However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded +correctly. + +To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a +custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). + +::: + ```js // jest.config.js module.exports = { @@ -64,14 +75,3 @@ module.exports = { } } ``` - -:::tip - -Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. -However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded -correctly. - -To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a -custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). - -::: diff --git a/website/versioned_docs/version-11.0/guides/esm-support.md b/website/versioned_docs/version-11.0/guides/esm-support.md index c2d3870269..ebd010b19f 100644 --- a/website/versioned_docs/version-11.0/guides/esm-support.md +++ b/website/versioned_docs/version-11.0/guides/esm-support.md @@ -53,6 +53,17 @@ module.exports = { #### Use ESM presets +:::tip + +Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. +However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded +correctly. + +To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a +custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). + +::: + ```js // jest.config.js module.exports = { @@ -70,14 +81,3 @@ module.exports = { } } ``` - -:::tip - -Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. -However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded -correctly. - -To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a -custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). - -::: diff --git a/website/versioned_docs/version-11.1/guides/esm-support.md b/website/versioned_docs/version-11.1/guides/esm-support.md index c2d3870269..ebd010b19f 100644 --- a/website/versioned_docs/version-11.1/guides/esm-support.md +++ b/website/versioned_docs/version-11.1/guides/esm-support.md @@ -53,6 +53,17 @@ module.exports = { #### Use ESM presets +:::tip + +Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. +However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded +correctly. + +To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a +custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). + +::: + ```js // jest.config.js module.exports = { @@ -70,14 +81,3 @@ module.exports = { } } ``` - -:::tip - -Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. -However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded -correctly. - -To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a -custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). - -::: diff --git a/website/versioned_docs/version-12.0/guides/esm-support.md b/website/versioned_docs/version-12.0/guides/esm-support.md index db0aacb55e..384ab6e39c 100644 --- a/website/versioned_docs/version-12.0/guides/esm-support.md +++ b/website/versioned_docs/version-12.0/guides/esm-support.md @@ -59,6 +59,17 @@ module.exports = { #### Use ESM presets +:::tip + +Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. +However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded +correctly. + +To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a +custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). + +::: + ```js // jest.config.js module.exports = { @@ -76,14 +87,3 @@ module.exports = { } } ``` - -:::tip - -Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. -However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded -correctly. - -To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a -custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). - -::: diff --git a/website/versioned_docs/version-9.x/guides/esm-support.md b/website/versioned_docs/version-9.x/guides/esm-support.md index 8cf46020ba..04a26879c3 100644 --- a/website/versioned_docs/version-9.x/guides/esm-support.md +++ b/website/versioned_docs/version-9.x/guides/esm-support.md @@ -47,6 +47,17 @@ module.exports = { #### Use ESM presets +:::tip + +Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. +However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded +correctly. + +To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a +custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). + +::: + ```js // jest.config.js module.exports = { @@ -64,14 +75,3 @@ module.exports = { } } ``` - -:::tip - -Jest will attempt to load **ESM** files from `node_modules` with default `jest-resolve` which usually works for most of the cases. -However, there are cases like Angular libraries **ESM** built files or **ESM** files which are outside `node_modules` might not be loaded -correctly. - -To fix that, one can use `moduleNameMapper` in jest config to instruct Jest to load the correct **ESM** files or create a -custom Jest [resolver](https://jestjs.io/docs/configuration#resolver-string). - -:::