Skip to content

Commit

Permalink
Use moment-timezone-data-webpack-plugin to optimize timezones shipped…
Browse files Browse the repository at this point in the history
… in wp/date (#51519)

* Use moment-timezone-data-webpack-plugin to optimize timezones shipped in wp/date

* Change the end year to 2040
  • Loading branch information
jsnajdr committed Jun 30, 2023
1 parent 1fa932c commit 8c91da7
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
98 changes: 98 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
"metro-react-native-babel-transformer": "0.70.3",
"mkdirp": "0.5.1",
"mock-match-media": "0.4.2",
"moment-timezone-data-webpack-plugin": "1.5.1",
"nock": "12.0.3",
"node-fetch": "2.6.1",
"node-watch": "0.7.0",
Expand Down
5 changes: 5 additions & 0 deletions tools/webpack/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
const CopyWebpackPlugin = require( 'copy-webpack-plugin' );
const MomentTimezoneDataPlugin = require( 'moment-timezone-data-webpack-plugin' );
const { join } = require( 'path' );

/**
Expand Down Expand Up @@ -157,5 +158,9 @@ module.exports = {
.concat( bundledPackagesPhpConfig )
.concat( vendorsCopyConfig ),
} ),
new MomentTimezoneDataPlugin( {
startYear: 2000,
endYear: 2040,
} ),
].filter( Boolean ),
};

0 comments on commit 8c91da7

Please sign in to comment.