🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@giovannilaperna/moment-locales-vite-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@giovannilaperna/moment-locales-vite-plugin

Strip unused locales from Moment.js

unpublished
latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

moment-locales-vite-plugin

Easily remove unused Moment.js locales when building with webpack

Forked from moment-locales-webpack-plugin and converted with webpack-to-vite with:

webpack-to-vite /home/giovanni/Documents/Dev/moment-locales-webpack-plugin --projectType webpack --entry index.js

Install

npm install --save-dev @giovannilaperna/moment-locales-vite-plugin

Usage

vite.config.js

import { defineConfig } from 'vite'
import MomentLocalesPlugin from ' @giovannilaperna/moment-locales-vite-plugin'

export default defineConfig({
  plugins: [
    MomentLocalesPlugin({
      localesToKeep: ['es', 'it']
    })
  ]
})

Plugin Options

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.

License

MIT © Giovanni La Perna

Keywords

vitejs

FAQs

Package last updated on 26 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts