Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
codehz committed Nov 26, 2024
1 parent b04df36 commit fafbc43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Glob, Transpiler, fileURLToPath, pathToFileURL } from "bun";
import { basename, join, parse, relative } from "node:path";
import { hashremap } from "./hash";

function escapeRegExp(string: string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
Expand Down Expand Up @@ -125,3 +124,8 @@ export async function build({
}
return result;
}

function hashremap(input: string, hash: string) {
const parsed = parse(input);
return `${join(parsed.dir, parsed.name)}-${hash}${parsed.ext}`;
}
1 change: 1 addition & 0 deletions scripts/dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ contents.version = spawnSync("git", ["describe", "--tags"], {
.replace(/^v/, "");
delete contents.devDependencies["bun-plugin-dts"];
await Bun.write("dist/package.json", JSON.stringify(contents, null, 2));
process.exit(0);

0 comments on commit fafbc43

Please sign in to comment.