moment-timezone-data-webpack-plugin
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"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'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16104
176
- Removedmake-dir@1.3.0(transitive)
- Removedpify@3.0.0(transitive)
Updatedmake-dir@^2.0.0