Skip to content

Commit

Permalink
docs(devs-infra): add moduleNameMapper example for .js imports in…
Browse files Browse the repository at this point in the history
… example ESM configs (#2922)

reference: #1709 (comment)
  • Loading branch information
acusti committed Sep 25, 2021
1 parent 63c5694 commit e37a1ce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions website/docs/guides/esm-support.md
Expand Up @@ -23,6 +23,9 @@ module.exports = {
useESM: true,
},
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}
```

Expand All @@ -36,6 +39,9 @@ module.exports = {
"ts-jest": {
"useESM": true
}
},
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
}
}
}
Expand All @@ -53,6 +59,9 @@ module.exports = {
useESM: true,
},
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}
```

Expand All @@ -66,6 +75,9 @@ module.exports = {
"ts-jest": {
"useESM": true
}
},
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions website/versioned_docs/version-27.0/guides/esm-support.md
Expand Up @@ -23,6 +23,9 @@ module.exports = {
useESM: true,
},
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}
```

Expand All @@ -36,6 +39,9 @@ module.exports = {
"ts-jest": {
"useESM": true
}
},
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
}
}
}
Expand All @@ -53,6 +59,9 @@ module.exports = {
useESM: true,
},
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}
```

Expand All @@ -66,6 +75,9 @@ module.exports = {
"ts-jest": {
"useESM": true
}
},
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
}
}
}
Expand Down

0 comments on commit e37a1ce

Please sign in to comment.