From 4482555931dda51dc6739d04d9b5a57178a8762a Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Wed, 28 Apr 2021 11:25:15 -0300 Subject: [PATCH] Removes unecessary locales for moment js (so far) --- package-lock.json | 15 +++++++++++++++ package.json | 1 + webpack.common.js | 6 +++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 48fd6890e..28ba6b82e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6463,6 +6463,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", + "dev": true + }, "loglevel": { "version": "1.6.8", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.8.tgz", @@ -6836,6 +6842,15 @@ "resolved": "https://registry.npmjs.org/moment/-/moment-2.25.3.tgz", "integrity": "sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg==" }, + "moment-locales-webpack-plugin": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/moment-locales-webpack-plugin/-/moment-locales-webpack-plugin-1.2.0.tgz", + "integrity": "sha512-QAi5v0OlPUP7GXviKMtxnpBAo8WmTHrUNN7iciAhNOEAd9evCOvuN0g1N7ThIg3q11GLCkjY1zQ2saRcf/43nQ==", + "dev": true, + "requires": { + "lodash.difference": "^4.5.0" + } + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", diff --git a/package.json b/package.json index 9668e5286..7503919bc 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "eslint-loader": "^2.2.1", "eslint-plugin-vue": "^5.2.3", "file-loader": "^2.0.0", + "moment-locales-webpack-plugin": "^1.2.0", "postcss-loader": "^3.0.0", "sass-loader": "^7.3.1", "style-loader": "^0.23.1", diff --git a/webpack.common.js b/webpack.common.js index 545c16876..4d45c12af 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,5 +1,6 @@ let path = require('path'); const webpack = require('webpack'); +const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); module.exports = { entry: { @@ -110,6 +111,9 @@ module.exports = { new webpack.ProvidePlugin({ 'Swiper': 'Swiper', 'PhotoSwipe': 'PhotoSwipe' - }) + }), + new MomentLocalesPlugin({ + localesToKeep: ['en', 'en-ca', 'en-nz', 'en-gb', 'es-au', 'es-in', 'pt-br', 'pt', 'es', 'es-us', 'es-do', 'fr', 'fr-ch', 'fr-ca', 'sv'], + }), ] }; \ No newline at end of file