Open berndnoll opened 2 years ago
Hi.
Any advice on how to use the max version in a pkg package?
I guess none. I haven't ever hear of that "pkg" thing.
What about using max as a default instead of min?
What about using max as a default instead of min?
What?
I am talking about the metadata set. Why not make "max" the default metadata set instead of "min".
Or is there any other way to use the "max" set without using require("libphonenumber-js/max")
?
Documentation I refer to: `This library provides different "metadata" sets, "metadata" being a list of phone number parsing and formatting rules for all countries. The complete list of those rules is huge, so this library provides a way to optimize bundle size by choosing between max, min, mobile and "custom" metadata:
max — The complete metadata set, is about 145 kilobytes in size (libphonenumber-js/metadata.full.json). Choose this when you need the most strict version of isValid(), or if you need to detect phone number type ("fixed line", "mobile", etc).`
Why not make "max" the default metadata set instead of "min".
Because of the size. See the readme.
Or is there any other way to use the "max" set without using require("libphonenumber-js/max")?
No.
I'm facing the same issue when trying to use this library submodules with pkg. It seems like pkg is not packaging it correctly.
Could be something with the way submodules were setup here, because with other libraries, like lodash
it works when importing submodules.
Hi there, great library, your work is very much appreciated! I have an issue with packaging the library into a standalone executable. (pkg)
const LPN = require("libphonenumber-js/max")
When I execute it gives me
pkg/prelude/bootstrap.js:1697 throw error; ^ Error: Cannot find module 'libphonenumber-js/max'
According to pkg logs it does include all the files in subdirectory max. Not sure if this is specific to this lib or a general pkg problem. Any advice on how to use the max version in a pkg package? Any workarounds?Thanks Bernd