Skip to content

Commit

Permalink
docs: update esm doc with moduleNameMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl committed Jan 21, 2025
1 parent 62beaf3 commit 82e132b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions website/docs/guides/esm-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import type { Config } from 'jest';
export default {
//...
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
tslib: 'tslib/tslib.es6.js',
'^rxjs': '<rootDir>/node_modules/rxjs/dist/bundles/rxjs.umd.js',
},
transform: {
'^.+\\.(ts|js|mjs|html|svg)$': [
'jest-preset-angular',
Expand Down Expand Up @@ -66,5 +70,9 @@ import presets from 'jest-preset-angular/presets';
export default {
//...
...presets.createEsmPreset(),
moduleNameMapper: {
tslib: 'tslib/tslib.es6.js',
'^rxjs': '<rootDir>/node_modules/rxjs/dist/bundles/rxjs.umd.js',
},
} satisfies Config;
```
8 changes: 8 additions & 0 deletions website/versioned_docs/version-14.5/guides/esm-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import type { Config } from 'jest';
export default {
//...
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
tslib: 'tslib/tslib.es6.js',
'^rxjs': '<rootDir>/node_modules/rxjs/dist/bundles/rxjs.umd.js',
},
transform: {
'^.+\\.(ts|js|mjs|html|svg)$': [
'jest-preset-angular',
Expand Down Expand Up @@ -66,5 +70,9 @@ import presets from 'jest-preset-angular/presets';
export default {
//...
...presets.createEsmPreset(),
moduleNameMapper: {
tslib: 'tslib/tslib.es6.js',
'^rxjs': '<rootDir>/node_modules/rxjs/dist/bundles/rxjs.umd.js',
},
} satisfies Config;
```

0 comments on commit 82e132b

Please sign in to comment.