mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-02 12:18:15 +08:00
fix: deps check error when dev add production plugin (#3848)
* fix: deps check error when dev add production plugin * fix: bug
This commit is contained in:
parent
28ca702ab9
commit
88b317f937
@ -505,15 +505,24 @@ export interface DepCompatible {
|
||||
}
|
||||
export async function getCompatible(packageName: string) {
|
||||
let externalVersion: Record<string, string>;
|
||||
if (!process.env.IS_DEV_CMD) {
|
||||
const hasSrc = fs.existsSync(path.join(getPackageDir(packageName), 'src'));
|
||||
let hasError = false;
|
||||
if (hasSrc) {
|
||||
try {
|
||||
externalVersion = await getExternalVersionFromSource(packageName);
|
||||
} catch (error) {
|
||||
console.log('getExternalVersionFromSource error:', error);
|
||||
hasError = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasError || !hasSrc) {
|
||||
const res = await getExternalVersionFromDistFile(packageName);
|
||||
if (!res) {
|
||||
return false;
|
||||
} else {
|
||||
externalVersion = res;
|
||||
}
|
||||
} else {
|
||||
externalVersion = await getExternalVersionFromSource(packageName);
|
||||
}
|
||||
|
||||
return Object.keys(externalVersion).reduce<DepCompatible[]>((result, packageName) => {
|
||||
|
2
packages/plugins/@nocobase/plugin-cas/.npmignore
Normal file
2
packages/plugins/@nocobase/plugin-cas/.npmignore
Normal file
@ -0,0 +1,2 @@
|
||||
/node_modules
|
||||
/src
|
Loading…
Reference in New Issue
Block a user