fix: development environment does not load the client's locale file

This commit is contained in:
chenos 2023-08-24 21:38:46 +08:00
parent 54692387d0
commit a0599e0638

View File

@ -12,6 +12,14 @@ export const getResource = (packageName: string, lang: string, isPlugin = true)
const resources = []; const resources = [];
const prefixes = [isPlugin ? 'dist' : 'lib']; const prefixes = [isPlugin ? 'dist' : 'lib'];
if (process.env.APP_ENV !== 'production') { 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'); prefixes.unshift('src');
} }
for (const prefix of prefixes) { for (const prefix of prefixes) {