From 8aae90fdbb1065eee6e39d79cf03adc17c0a06ec Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Sun, 24 Dec 2023 17:22:09 +0900 Subject: [PATCH] =?UTF-8?q?(dev)=20=E7=BF=BB=E8=A8=B3=E3=81=AEyml=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=9F=E3=82=89=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E7=9A=84=E3=81=ABJSON=E3=81=AB=E5=A4=89=E6=8F=9B=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nuxt.config.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 971da58e..a93dbf27 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,7 +1,7 @@ // https://nuxt.com/docs/api/configuration/nuxt-config import yaml from '@rollup/plugin-yaml'; import svgLoader from 'vite-svg-loader'; -import { readFileSync } from 'fs'; +import { readFileSync, watch as fsWatch } from 'fs'; import { genApiTranslationFiles } from './scripts/gen-api-translations'; import { getOldHubRedirects } from './scripts/get-old-hub-redirects'; import { genLocalesJson } from './scripts/gen-locales'; @@ -175,6 +175,13 @@ export default defineNuxtConfig({ 'build:before': async (...args) => { genApiTranslationFiles(...args); genLocalesJson(...args); + if (process.env.NODE_ENV === 'development') { + fsWatch('./locales/', (ev, filename) => { + if (filename && filename.endsWith('.yml')) { + genLocalesJson(...args); + } + }); + } await fetchCrowdinMembers(...args); }, },