Skip to content

Commit 4d90979

Browse files
committed
add pnpm example
1 parent 91e6cf2 commit 4d90979

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

docs/angular/build-options.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import Tabs from '@theme/Tabs';
2+
import TabItem from '@theme/TabItem';
3+
14
# Build Options
25

36
Developers have two options for using Ionic components: Standalone or Modules. This guide covers both options as well as the benefits and downsides of each approach.
@@ -179,12 +182,22 @@ export class HomePage {}
179182

180183
Ionic Angular's standalone components use ES Modules. As a result, developers using Jest should ensure that ES Modules are transpiled to a format that Jest can use. Developers using Jest should add the following to their Jest config:
181184

185+
<Tabs groupId="package-manager" defaultValue="npm" values={[{ value: 'npm', label: 'npm' }, { value: 'pnpm', label: 'pnpm' }]}>
186+
<TabItem value="npm">
187+
182188
```json
183-
{
184-
...,
185-
"transformIgnorePatterns": ["node_modules/(?!(@ionic/angular|@ionic/core|ionicons|@stencil/core|@angular/*)/)"]
186-
}
189+
190+
"transformIgnorePatterns": ["<rootDir>/node_modules/(?!(@ionic/angular|@ionic/core|ionicons|@stencil/core|@angular/*)/)"]
191+
```
192+
</TabItem>
193+
<TabItem value="pnpm">
194+
195+
```json
196+
197+
"transformIgnorePatterns": ["<rootDir>/node_modules/.pnpm/(?!(@ionic/angular|@ionic/core|ionicons|@stencil/core|@angular/*)@)"]
187198
```
199+
</TabItem>
200+
</Tabs>
188201

189202
### Usage with NgModule-based Applications
190203

@@ -326,6 +339,28 @@ export class HomePageModule {}
326339
<ion-button routerLink="/foo" routerDirection="root">Go to Foo Page</ion-button>
327340
```
328341

342+
**Testing**
343+
344+
Ionic Angular's standalone components use ES Modules. As a result, developers using Jest should ensure that ES Modules are transpiled to a format that Jest can use. Developers using Jest should add the following to their Jest config:
345+
346+
<Tabs groupId="package-manager" defaultValue="npm" values={[{ value: 'npm', label: 'npm' }, { value: 'pnpm', label: 'pnpm' }]}>
347+
<TabItem value="npm">
348+
349+
```json
350+
351+
"transformIgnorePatterns": ["<rootDir>/node_modules/(?!(@ionic/angular|@ionic/core|ionicons|@stencil/core|@angular/*)/)"]
352+
```
353+
</TabItem>
354+
<TabItem value="pnpm">
355+
356+
```json
357+
358+
"transformIgnorePatterns": ["<rootDir>/node_modules/.pnpm/(?!(@ionic/angular|@ionic/core|ionicons|@stencil/core|@angular/*)@)"]
359+
```
360+
</TabItem>
361+
</Tabs>
362+
363+
329364
## Modules
330365

331366
### Overview

0 commit comments

Comments
 (0)