Skip to content
Snippets Groups Projects
Commit e4b807a0 authored by Alex Yang's avatar Alex Yang
Browse files

fix(core): invalid package.json

parent 0a0ec377
No related branches found
No related tags found
No related merge requests found
...@@ -5,9 +5,21 @@ ...@@ -5,9 +5,21 @@
*/ */
import editJsonFile from "edit-json-file"; import editJsonFile from "edit-json-file";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
await fs.copyFile("./package.json", "./dist/package.json");
const file = editJsonFile("./dist/package.json");
file.unset("scripts"); {
file.unset("private"); await fs.copyFile("./package.json", "./dist/package.json");
await new Promise((resolve) => file.save(resolve)); const file = editJsonFile("./dist/package.json");
file.unset("scripts");
file.unset("private");
await new Promise((resolve) => file.save(resolve));
}
{
const packageJson = await fs.readFile("./dist/package.json", "utf8");
const modifiedPackageJson = packageJson.replaceAll("./dist/", "./");
await fs.writeFile(
"./dist/package.json",
JSON.stringify(JSON.parse(modifiedPackageJson), null, 2),
"utf8",
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment