-
Notifications
You must be signed in to change notification settings - Fork 842
Closed
Labels
status: done/releasedIssue has been completed, no further action is needed.Issue has been completed, no further action is needed.type: fixIssues describing a broken feature.Issues describing a broken feature.
Description
In validators.ts, line 20-22:
private libPhoneNumber = {
phoneUtil: require("google-libphonenumber").PhoneNumberUtil.getInstance(),
};
When class-validator is bundled with webpack, google-libphonenumber, which represents 71% of the bundle size, is embedded, even if you don't use the phone number validator. See this bundle analysis made with webpack-bundle-analyzer:
Validators should be split into different files, allowing to import only the needed files without extra code and thus enabling proper tree shaking when bundling dependencies with webpack.
AndrinGautschi
Metadata
Metadata
Assignees
Labels
status: done/releasedIssue has been completed, no further action is needed.Issue has been completed, no further action is needed.type: fixIssues describing a broken feature.Issues describing a broken feature.
