Skip to content

Commit

Permalink
chore: restore migration guide v5
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Apr 19, 2022
1 parent 93e31a9 commit 7cec578
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/migration-guide-v5/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ Tree shaking is not yet fully supported due to some structural issues. But we pl

For now Faker supports tree-shaking for some parts, and we highly recommend that you take advantage of your bundler's tree-shaking capabilities and change how you import Faker right now.

Instead of using:

```ts
// js
const faker = require('@faker-js/faker');

// ts
import faker from '@faker-js/faker';
```

You should switch to:

```ts
// js
const { faker } = require('@faker-js/faker');

// ts
import { faker } from '@faker-js/faker';
```

If you only need one specific language, we highly recommend to make use of the locale specific imports like:

```ts
Expand Down

0 comments on commit 7cec578

Please sign in to comment.