Skip to content

Commit

Permalink
docs(devs-infra): update ESM doc (#1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl authored May 11, 2022
1 parent 8e990e6 commit 342b21d
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 66 deletions.
22 changes: 11 additions & 11 deletions website/docs/guides/esm-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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).

:::
22 changes: 11 additions & 11 deletions website/versioned_docs/version-10.x/guides/esm-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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).

:::
22 changes: 11 additions & 11 deletions website/versioned_docs/version-11.0/guides/esm-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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).

:::
22 changes: 11 additions & 11 deletions website/versioned_docs/version-11.1/guides/esm-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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).

:::
22 changes: 11 additions & 11 deletions website/versioned_docs/version-12.0/guides/esm-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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).

:::
22 changes: 11 additions & 11 deletions website/versioned_docs/version-9.x/guides/esm-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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).

:::

0 comments on commit 342b21d

Please sign in to comment.