Skip to content

Commit

Permalink
🐛 Fix top level await bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dmoyadev committed May 17, 2024
1 parent 9b67666 commit aec39c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.0.1-alpha.9",
"scripts": {
"dev": "vite --mode localhost --host --port 5777",
"build": "rm -rf dist && vue-tsc && vite build",
"build": "rm -rf dist && vite build",
"preview": "vite preview --host --port 4777",
"lint": "eslint --fix",
"check-typing": "vue-tsc --noEmit",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const i18n = createI18n<[MessageSchema], typeof SUPPORTED_LOCALES[number]

availableLocales: [...SUPPORTED_LOCALES],
});
await changeLocale(getDefaultLocale() as typeof SUPPORTED_LOCALES[number]);
void changeLocale(getDefaultLocale() as typeof SUPPORTED_LOCALES[number]);

export async function changeLocale(locale: typeof SUPPORTED_LOCALES[number]) {
// load locale messages with dynamic import
Expand Down
8 changes: 6 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import { resolve } from 'path';
import vue from '@vitejs/plugin-vue';
import mkcert from 'vite-plugin-mkcert';

Expand All @@ -9,11 +9,15 @@ export default defineConfig({
vue(), // Use the Vue.js plugin
mkcert(), // Use mkcert for enabling HTTPS in localhost
],

resolve: {
alias: {
'~': resolve(__dirname, 'src'), // Set an alias for the 'src' directory
'@': resolve(__dirname, 'src'), // Set an alias for the 'src' directory
},
},

build: {
target: 'esnext', // Use the latest ECMAScript standard
},
});

0 comments on commit aec39c7

Please sign in to comment.