Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Support moment-locales-webpack-plugin #6373

Closed
SyMind opened this issue Apr 26, 2024 · 0 comments · Fixed by #6420
Closed

[Feature]: Support moment-locales-webpack-plugin #6373

SyMind opened this issue Apr 26, 2024 · 0 comments · Fixed by #6420
Assignees
Labels
feat New feature or request

Comments

@SyMind
Copy link
Member

SyMind commented Apr 26, 2024

What problem does this feature solve?

Easily remove unused Moment.js locales when building with webpack.

https://www.npmjs.com/package/moment-locales-webpack-plugin

What does the proposed API of configuration look like?

const MomentLocalesPlugin = require('moment-locales-webpack-plugin');

module.exports = {
    plugins: [
        // To strip all locales except “en”
        new MomentLocalesPlugin(),
 
        // Or: To strip all locales except “en”, “es-us” and “ru”
        // (“en” is built into Moment and can’t be removed)
        new MomentLocalesPlugin({
            localesToKeep: ['es-us', 'ru'],
        }),
    ],
};
@SyMind SyMind added feat New feature or request pending triage The issue/PR is currently untouched. labels Apr 26, 2024
@SyMind SyMind self-assigned this Apr 26, 2024
@h-a-n-a h-a-n-a removed the pending triage The issue/PR is currently untouched. label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants