From a0599e06380ae5b786790aa87d3d57ce92149d2f Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 24 Aug 2023 21:38:46 +0800 Subject: [PATCH] fix: development environment does not load the client's locale file --- packages/core/server/src/locale/resource.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core/server/src/locale/resource.ts b/packages/core/server/src/locale/resource.ts index 56bc3cc0c..f9d7a56f7 100644 --- a/packages/core/server/src/locale/resource.ts +++ b/packages/core/server/src/locale/resource.ts @@ -12,6 +12,14 @@ export const getResource = (packageName: string, lang: string, isPlugin = true) const resources = []; const prefixes = [isPlugin ? 'dist' : 'lib']; if (process.env.APP_ENV !== 'production') { + try { + require.resolve('@nocobase/client/src'); + if (packageName === '@nocobase/plugin-client') { + packageName = '@nocobase/client'; + } + } catch (error) { + // empty + } prefixes.unshift('src'); } for (const prefix of prefixes) {