We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
bin
1 parent 5285b78 commit 4cd8628Copy full SHA for 4cd8628
script/build.js
@@ -1,5 +1,6 @@
1
import { build } from "esbuild";
2
import { readFileSync } from "fs";
3
+import { chmod } from "fs/promises";
4
5
build({
6
entryPoints: ["src/webauthn-json/index.ts"],
@@ -40,12 +41,14 @@ build({
40
41
const { version } = JSON.parse(
42
readFileSync(new URL("../package.json", import.meta.url)),
43
);
-build({
44
+await build({
45
entryPoints: ["src/bin/main.ts"],
46
format: "esm",
47
target: "es2020",
48
bundle: true,
49
sourcemap: true,
50
define: { WEBAUTHN_JSON_VERSION: JSON.stringify(version) },
51
+ banner: { js: "#!/usr/bin/env node" },
52
outfile: "dist/bin/main.js",
53
});
54
+chmod("dist/bin/main.js", 0o755);
0 commit comments