mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
install: fix package.json
This commit is contained in:
1 parent
6acd1fed9f
commit
39e3d057fa
1 file changed
+2
-2
+2
-2
@@ -120,12 +120,11 @@ uid: 1536
|
|||||||
gid: 1536
|
gid: 1536
|
||||||
`;
|
`;
|
||||||
|
|
||||||
let data;
|
|
||||||
function removeOptionalEsbuildDeps() {
|
function removeOptionalEsbuildDeps() {
|
||||||
const yarnGlobalPath = exec('yarn global dir').output?.trim() || '';
|
const yarnGlobalPath = exec('yarn global dir').output?.trim() || '';
|
||||||
if (!yarnGlobalPath) return false;
|
if (!yarnGlobalPath) return false;
|
||||||
const pkgjson = `${yarnGlobalPath}/package.json`;
|
const pkgjson = `${yarnGlobalPath}/package.json`;
|
||||||
data = existsSync(pkgjson) ? require(pkgjson) : {};
|
const data = existsSync(pkgjson) ? require(pkgjson) : {};
|
||||||
data.resolutions = data.resolutions || {};
|
data.resolutions = data.resolutions || {};
|
||||||
Object.assign(data.resolutions, Object.fromEntries([
|
Object.assign(data.resolutions, Object.fromEntries([
|
||||||
'@esbuild/linux-loong64',
|
'@esbuild/linux-loong64',
|
||||||
@@ -147,6 +146,7 @@ function rollbackResolveField() {
|
|||||||
const yarnGlobalPath = exec('yarn global dir').output?.trim() || '';
|
const yarnGlobalPath = exec('yarn global dir').output?.trim() || '';
|
||||||
if (!yarnGlobalPath) return false;
|
if (!yarnGlobalPath) return false;
|
||||||
const pkgjson = `${yarnGlobalPath}/package.json`;
|
const pkgjson = `${yarnGlobalPath}/package.json`;
|
||||||
|
const data = JSON.parse(readFileSync(pkgjson, 'utf-8'));
|
||||||
delete data.resolutions;
|
delete data.resolutions;
|
||||||
writeFileSync(pkgjson, JSON.stringify(data, null, 2));
|
writeFileSync(pkgjson, JSON.stringify(data, null, 2));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in new issue
Block a user