Skip to content

Commit

Permalink
Fix clean build
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Oct 4, 2024
1 parent 9bc8bb5 commit 17563cf
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@ const startTime = Date.now();

const distDirPath = pathJoin(getThisCodebaseRootDirPath(), "dist");

transformCodebase({
"srcDirPath": distDirPath,
"destDirPath": distDirPath,
"transformSourceCode": ({ filePath, sourceCode }) => {
if (filePath === "package.json") {
return { "modifiedSourceCode": sourceCode };
}

return undefined;
clean: {
if (!fs.existsSync(distDirPath)) {
break clean;
}
});

transformCodebase({
"srcDirPath": distDirPath,
"destDirPath": distDirPath,
"transformSourceCode": ({ filePath, sourceCode }) => {
if (filePath === "package.json") {
return { "modifiedSourceCode": sourceCode };
}

return undefined;
}
});
}

const packageJsonFilePath = pathJoin(getThisCodebaseRootDirPath(), "package.json");

Expand Down

0 comments on commit 17563cf

Please sign in to comment.