diff --git a/frontend_build/baseWebpackConfig.js b/frontend_build/baseWebpackConfig.js index 69f6c401a6d..f68bf133538 100644 --- a/frontend_build/baseWebpackConfig.js +++ b/frontend_build/baseWebpackConfig.js @@ -20,6 +20,7 @@ if (!process.env.NODE_ENV) process.env.NODE_ENV = 'development' const glob = require('glob') const ManifestPlugin = require('webpack-manifest-plugin') +const MomentTimezoneDataPlugin = require('moment-timezone-data-webpack-plugin') const path = require('path') const webpack = require('webpack') const WebpackCleanupPlugin = require('webpack-cleanup-plugin') @@ -245,6 +246,13 @@ module.exports = { GIT_COMMIT: null }), + // Only include timezone data starting from 2011 (canvaseption) to 15 years from now, + // so we don't clutter the vendor bundle with a bunch of old timezone data + new MomentTimezoneDataPlugin({ + startYear: 2011, + endYear: new Date().getFullYear() + 15 + }), + new WebpackCleanupPlugin({ exclude: ['selinimum-manifest.json'] }), diff --git a/package.json b/package.json index 661fe167e26..fa85aab9957 100644 --- a/package.json +++ b/package.json @@ -197,6 +197,7 @@ "lint-staged": "^8.1.0", "merge-stream": "^1", "mockdate": "^2.0.2", + "moment-timezone-data-webpack-plugin": "^1.0.3", "moxios": "^0.4", "nyc": "^13", "prettier": "^1", diff --git a/yarn.lock b/yarn.lock index ec97b18fa50..c22bd7251fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11464,6 +11464,14 @@ make-dir@^1.0.0, make-dir@^1.3.0: dependencies: pify "^3.0.0" +make-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + make-error-cause@^1.1.1: version "1.2.2" resolved "https://registry.yarnpkg.com/make-error-cause/-/make-error-cause-1.2.2.tgz#df0388fcd0b37816dff0a5fb8108939777dcbc9d" @@ -12033,6 +12041,14 @@ module-not-found-error@^1.0.0: resolved "https://registry.yarnpkg.com/module-not-found-error/-/module-not-found-error-1.0.1.tgz#cf8b4ff4f29640674d6cdd02b0e3bc523c2bbdc0" integrity sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA= +moment-timezone-data-webpack-plugin@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/moment-timezone-data-webpack-plugin/-/moment-timezone-data-webpack-plugin-1.0.3.tgz#0221a34a00a5631c362b1cca9fea81b06155c524" + integrity sha512-dO8Kwz+KU+v1PCw5xGhIoIhuZg48vO67PW5JKb7s8+fNHBOojI7rxfiq88KH1J/We+0pCPEOkUIsTSrcuaz4xg== + dependencies: + find-cache-dir "^2.0.0" + make-dir "^2.0.0" + moment-timezone@^0.5, moment-timezone@^0.5.13: version "0.5.23" resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.23.tgz#7cbb00db2c14c71b19303cb47b0fb0a6d8651463"