-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
c: featureRequest for new featureRequest for new features: waiting for user interestWaiting for more users interested in this featureWaiting for more users interested in this feature
Description
Clear and concise description of the problem
Currently anything inside a locale object such as en
is never tree shaken even if you only need one submodule/language file from it. This applies also if you manually deconstruct and reassemble it.
Suggested solution
Add imports/exports for localization files.
E.g.
import { person } from '@faker-js/faker/locales/en';
import { firstName } from '@faker-js/faker/locales/en/person';
For my usecase it would be sufficient to get access on the module level e.g. person, but others may want to narrow it down more.
This might require some changes on how locale files are joined at least if the imports should be most convinient.
// module.ts
export first_name from './first_name';
// locale.ts
export * as person from './person';
Alternative
Alt1) Provide other ways to access subsets of locales.
Alt2) Combine #2667 with pre-built per locale nano instances.
Additional context
No response
github-actions and ST-DDT
Metadata
Metadata
Assignees
Labels
c: featureRequest for new featureRequest for new features: waiting for user interestWaiting for more users interested in this featureWaiting for more users interested in this feature