Skip to content

Commit

Permalink
docs: add lines needed for vitest and ionic integration (#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanClementsHax authored Jun 18, 2024
1 parent 22f491c commit e029a28
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions apps/docs-app/docs/integrations/ionic/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,30 @@ pnpm install ionicons

## Step 2: Configuring Ionic Framework in your application

1. Update your `vite.config.ts` file to exclude Ionic packages from the **SSR** process, adding them to the `noExternal` property. ionicons is required only if you installed the ionicons package.

```json
ssr: {
noExternal: [
'@ionic/**',
'@stencil/**',
'ionicons',
],
},
1. Update your `vite.config.ts` file to include Ionic packages in the **SSR** process, adding them to the `noExternal` array. ionicons is required only if you installed the ionicons package. If you use Vitest, inline the @ionic/angular package to allow Vitest to build that package properly for Vitest.

```ts
export default defineConfig(({ mode }) => {
return {
// ...

// add these lines
ssr: {
noExternal: ['@ionic/**', '@stencil/**', 'ionicons'],
},

// ...

// add these lines if you use Vitest
test: {
server: {
deps: {
inline: ['@ionic/angular'],
},
},
},
};
});
```

2. Add in your `app.config.ts` the `provideIonicAngular` method and `IonicRouteStrategy` provider.
Expand Down

0 comments on commit e029a28

Please sign in to comment.