fix: build
This commit is contained in:
parent
fa91538581
commit
690a275f1a
@ -10,7 +10,8 @@
|
||||
"nocobase-build": "./bin/nocobase-build.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup"
|
||||
"build": "tsup",
|
||||
"prepare": "tsup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "7.22.10",
|
||||
|
@ -16,10 +16,12 @@ import {
|
||||
readFileSync,
|
||||
writeFileSync as _writeFileSync,
|
||||
} from 'fs';
|
||||
import { createRequire } from 'module';
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
export function isPackageValid(pkg: string) {
|
||||
try {
|
||||
import.meta.resolve(join(process.cwd(), pkg));
|
||||
require(pkg)
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user