From ce48bd55f1cea6d52cc03e0ad0a320d015a7196c Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 19 Oct 2022 23:16:22 +0100 Subject: [PATCH] Fix vite from complaining about import analysis. --- src/App.vue | 6 +++--- src/main.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index c5dce7a2..be3ba6cc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -63,9 +63,9 @@ export default { const defaultLang = await App.defaultLangage; const locale = App.getPreferenceString("hl", defaultLang); if (locale !== App.TimeAgoConfig.locale) { - const localeTime = await import( - "./../node_modules/javascript-time-ago/locale/" + locale + ".json" - ).then(module => module.default); + const localeTime = await import(`../node_modules/javascript-time-ago/locale/${locale}.json`).then( + module => module.default, + ); App.TimeAgo.addLocale(localeTime); App.TimeAgoConfig.locale = locale; } diff --git a/src/main.js b/src/main.js index 9ea9cf48..a83a8d46 100644 --- a/src/main.js +++ b/src/main.js @@ -253,7 +253,7 @@ const mixin = { const languages = window.navigator.languages; for (let i = 0; i < languages.length; i++) { try { - await import("./locales/" + languages[i] + ".json"); + await import(`./locales/${languages[i]}.json`); return languages[i]; } catch { continue;