DEV: Refactor moment.js loading (#32337)

- Load moment and moment-timezone-with-data via webpack import instead
of including copies in every locale file

- Fetch static files from node_modules instead of `vendor/`

This cuts the size of locale-specific JS files in half, since they no
longer include moment itself.
This commit is contained in:
David Taylor
2025-04-26 13:52:07 +01:00
committed by GitHub
parent 13ea673d18
commit fbc2cfb618
187 changed files with 36 additions and 22670 deletions

View File

@ -69,16 +69,6 @@ def dependencies
{ source: "chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.min.js", public: true },
{ source: "magnific-popup/dist/jquery.magnific-popup.min.js", public: true },
{ source: "pikaday/pikaday.js", public: true },
{ source: "moment/moment.js" },
{ source: "moment/locale/.", destination: "moment-locale" },
{
source: "moment-timezone/builds/moment-timezone-with-data-10-year-range.js",
destination: "moment-timezone-with-data.js",
},
{
source: "@discourse/moment-timezone-names-translations/locales/.",
destination: "moment-timezone-names-locale",
},
{
source: "squoosh/codecs/mozjpeg/enc/mozjpeg_enc.js",
destination: "squoosh",