#!/usr/bin/env bash # # Build the standalone `shard` CLI executable into dist/shard. # # The output is a single bundled JavaScript file with a `#!/usr/bin/env bun` shebang, # made executable so it can be run directly as `./dist/shard` or linked via the # package.json `bin` field. Packages stay external and resolve from node_modules at # runtime, keeping the bundle small. # # Run automatically by the `prepare` script (after `svelte-kit sync` generates the # `@/` path aliases in .svelte-kit/tsconfig.json) so a plain `bun install` yields a # usable `dist/shard`. set -euo pipefail mkdir -p dist bun build src/cli/index.ts \ --outfile dist/shard \ --target bun \ --packages external \ --banner "#!/usr/bin/env bun" chmod +x dist/shard echo "built dist/shard"