diff --git a/packages/safelight/buildscripts/vite-plugin-generate-i18n.ts b/packages/safelight/buildscripts/vite-plugin-generate-i18n.ts index 067e439..9705749 100644 --- a/packages/safelight/buildscripts/vite-plugin-generate-i18n.ts +++ b/packages/safelight/buildscripts/vite-plugin-generate-i18n.ts @@ -39,7 +39,11 @@ interface Options { async function compileTypes({ localesDir: dir, outputFile: output }: Options) { const files = await glob(dir + '/*.json', { signal: AbortSignal.timeout(1000) + }).catch((err) => { + console.error('Could not find i18n files:', err); + return [] as string[]; }); + if (!files.length) return; // Combine all files into 1 object const allFiles: Record = {}; @@ -94,7 +98,9 @@ declare module 'vue-i18n' { outputFile = outputFile.replace(/((? + console.error('Error writing i18n definitions:', err) + ); } // Source: https://stackoverflow.com/a/34749873