I see that when importing Faker JS into my NodeJS project and then build it, it bundles the whole module inside it. I just want to bundle a specific module inside it. Is it possible?
I, for example, use only the faker.finance.currencyName()
function. I tried importing just import "faker/lib/finance"
but that doesn't seem to work. The dist bundle is a whopping 824.67kb (when doing npm run build
in vite-js).
Looking at what is exported, it does not appear that specific sub-modules can be imported.