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
Typescript
Module System
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
435 Stars
122 Commits
11 Forks
5 Watchers
9 Branches
5 Contributors
Updated on Nov 29, 2024
Latest Version
1.2.0
Package Id
moment-locales-webpack-plugin@1.2.0
Size
3.76 kB
Published on
Mar 15, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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
Found 0/1 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
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
31 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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