don’t include really old timezone data in JS bundle
closes: CORE-2770 we don’t need timezone data from before canvas was created (pre 2011) or, realistically, 15 years from now. by using this moment-timezone-data-webpack-plugin we can strip them out of our webpack bundle and our common vendor JS file will be smaller. and smaller js bundles = faster page loads test plan: * try to think of a compelling reason why we would need to properly handle timezone weirdness that is either older than 2011 or more than 15 years from now * if you can think of something, then we can’t do this * run the prod webpack build, the vendor file should be smaller Change-Id: I1823fb48cc14bc0687f5222d7f4344118825698e Reviewed-on: https://gerrit.instructure.com/188810 Tested-by: Jenkins Reviewed-by: Steven Burnett <sburnett@instructure.com> Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com> QA-Review: Steven Burnett <sburnett@instructure.com> Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
This commit is contained in:
parent
72b517b117
commit
2b8e4c1c2e
|
@ -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']
|
||||
}),
|
||||
|
|
|
@ -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",
|
||||
|
|
16
yarn.lock
16
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"
|
||||
|
|
Loading…
Reference in New Issue