Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

moment-timezone-data-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moment-timezone-data-webpack-plugin - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

package.json
{
"name": "moment-timezone-data-webpack-plugin",
"version": "1.0.1",
"version": "1.0.2",
"description": "Remove unneeded data from moment-timezone in a webpack build",

@@ -28,3 +28,3 @@ "main": "src/index.js",

"find-cache-dir": "^2.0.0",
"make-dir": "^1.3.0"
"make-dir": "^2.0.0"
},

@@ -31,0 +31,0 @@ "peerDependencies": {

@@ -18,2 +18,3 @@ # moment-timezone-data-webpack-plugin

- [Plugin options](#plugin-options)
- [Version support](#version-support)
- [Examples](#examples)

@@ -57,2 +58,4 @@ - [All zones, with a limited date range](#all-zones-with-a-limited-date-range)

Even if you still need all the time zones available, reducing the data to a much smaller date range can produce significant file size savings. Building the above example file with data for all zones from 2018 to 2028 produces a file size of 288KiB, or 74KiB gzipped.
### ⚠️ Make sure you know what you’re doing ❗️️

@@ -118,2 +121,7 @@

### Version support
This plugin has been tested with and supports webpack v4. It theoretically supports older versions of webpack (as it uses built-in webpack plugins internally), but this hasn’t been tested.
## Examples

@@ -120,0 +128,0 @@

@@ -82,5 +82,5 @@ const fs = require('fs');

return new webpack.NormalModuleReplacementPlugin(
/data\/packed\/latest\.json$/,
/data[\\/]packed[\\/]latest\.json$/,
resource => {
if (resource.context.match(/node_modules\/moment-timezone$/)) {
if (resource.context.match(/node_modules[\\/]moment-timezone$/)) {
const config = { matchZones, startYear, endYear };

@@ -87,0 +87,0 @@ const tzdata = require('moment-timezone/data/packed/latest.json');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc