Commit 12d3c6d
authored
feat: support Angular 13 in CJS mode (#1122)
BREAKING CHANGE
* **NodeJs** range version support now is `^12.20.0 || ^14.15.0 || >=16.10.0`
* Due to the introduction of **ESM package format** for Angular packages, several things are added to the **default preset** to handle `.mjs` files from **Angular ESM packages**:
+ `ng-jest-resolver` is introduced as a custom Jest resolver to resolve `.mjs` files.
+ `transformIgnorePatterns` is added to inform Jest to transform `.mjs` files.
+ `transform` is updated to include `.mjs` extension to transform to `CommonJS` codes.
If one has custom Jest config, please make sure to adjust Jest config for CJS mode as following:
```
// jest.config.js
module.exports = {
// other config
resolver: 'jest-preset-angular/build/resolvers/ng-jest-resolver.js',
transformIgnorePatterns: ['node_modules/(?!@angular)'],
transform: {
'^.+\\.(ts|js|mjs|html|svg)$': 'jest-preset-angular',
},
}
```1 parent b021d0e commit 12d3c6d
File tree
62 files changed
+8728
-176
lines changed- .github/workflows
- e2e
- ast-transformers
- downlevel-ctor
- ng-jit-transformers
- __tests__
- async
- snapshot-serializers
- with-babel
- examples/example-app-v13
- src
- app
- assets
- environments
- presets
- scripts
- src
- __tests__
- __snapshots__
- compiler
- resolvers
- transformers
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
62 files changed
+8728
-176
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
This file was deleted.
This file was deleted.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments