Improve build times

* Fix bulma/buefy being imported many (many !!!) times

* Remove javascript-time-ago because date-fns pretty much does the same
thing

* Make sure languages are loaded asynchronously

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-10-13 20:39:59 +02:00
parent f627cab292
commit 93cecbe49c
66 changed files with 167 additions and 283 deletions

View File

@@ -1,5 +1,5 @@
import Vue from "vue";
import Locale from "date-fns";
import VueInstance from "vue";
declare module "vue/types/vue" {
interface Vue {
@@ -7,8 +7,8 @@ declare module "vue/types/vue" {
}
}
export function DateFnsPlugin(vue: typeof Vue, { locale }: { locale: string }): void {
export function DateFnsPlugin(vue: typeof VueInstance, { locale }: { locale: string }): void {
import(`date-fns/locale/${locale}/index.js`).then((localeEntity) => {
Vue.prototype.$dateFnsLocale = localeEntity;
VueInstance.prototype.$dateFnsLocale = localeEntity;
});
}