Gathering detailed insights and metrics for moment-locales-webpack-plugin
Gathering detailed insights and metrics for moment-locales-webpack-plugin
Gathering detailed insights and metrics for moment-locales-webpack-plugin
Gathering detailed insights and metrics for moment-locales-webpack-plugin
Easily remove unused Moment.js locales with webpack
npm install moment-locales-webpack-plugin
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
434 Stars
122 Commits
11 Forks
6 Watching
9 Branches
5 Contributors
Updated on 18 Sept 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-18.3%
51,401
Compared to previous day
Last week
-12.9%
320,755
Compared to previous week
Last month
58.1%
1,652,833
Compared to previous month
Last year
1.5%
13,406,169
Compared to previous year
1
8
Easily remove unused Moment.js locales when building with webpack
75% (160 minified KBs)¹ of Moment.js’ size are files used for localization. They are always included when you build your app with webpack.
You don’t need most of these files if your app is only available in a few languages. Use this plugin to strip these KBs and optimize the app!
¹ – tested with Moment.js 2.18.1
1npm install --save-dev moment-locales-webpack-plugin
1// webpack.config.js 2const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); 3 4module.exports = { 5 plugins: [ 6 // To strip all locales except “en” 7 new MomentLocalesPlugin(), 8 9 // Or: To strip all locales except “en”, “es-us” and “ru” 10 // (“en” is built into Moment and can’t be removed) 11 new MomentLocalesPlugin({ 12 localesToKeep: ['es-us', 'ru'], 13 }), 14 ], 15};
localesToKeep: String[]
An array of locales to keep bundled (other locales would be removed).
Locale names follow Moment.js behavior – if a specific locale name (e.g. ru-ru
) is absent, but a more generic locale (ru
) is available, the generic one will be kept bundled.
ignoreInvalidLocales: Boolean
A flag to ignore invalid or unsupported locales in the localesToKeep
array.
Be careful! A typo in the localesToKeep
array with this flag enabled will silently exclude the desired locale from your bundle.
moment-timezone-data-webpack-plugin
– a plugin optimizing the Moment Timezone library.See CONTRIBUTING.md for how to contribute.
MIT © Ivan Akulov
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
25 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More