Describe the bug
Following the guide on the website, you just have to import { faker } from '@faker-js/faker';. That doesn't work. It actually makes it worse by adding a whopping 1/2MB to the bundle size.
The section above says, that you should only import what you need. Well I tried that as well:
import { address } from '@faker-js/faker' // error, no export address
import address from '@faker-js/faker/address'
address.city() // error, method not defined
So is this is supposed to work? Looking at the code, I can see why this is not treeshakeable. But why is it advertized?
Reproduction
I am using vite. So bundling is done by rollup. Using faker anywhere leads to the whole faker lib in your bundle
Additional Info
No response
Describe the bug
Following the guide on the website, you just have to
import { faker } from '@faker-js/faker';. That doesn't work. It actually makes it worse by adding a whopping 1/2MB to the bundle size.The section above says, that you should only import what you need. Well I tried that as well:
So is this is supposed to work? Looking at the code, I can see why this is not treeshakeable. But why is it advertized?
Reproduction
I am using vite. So bundling is done by rollup. Using faker anywhere leads to the whole faker lib in your bundle
Additional Info
No response