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