fix: development environment does not load the client's locale file
This commit is contained in:
parent
54692387d0
commit
a0599e0638
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user