prjct-cli 0.35.2 → 0.35.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/core/commands/analysis.ts +58 -32
  2. package/core/commands/command-data.ts +11 -50
  3. package/core/commands/commands.ts +18 -21
  4. package/core/commands/context.ts +238 -0
  5. package/core/commands/register.ts +7 -5
  6. package/core/commands/setup.ts +1 -17
  7. package/core/commands/workflow.ts +3 -2
  8. package/core/index.ts +2 -4
  9. package/core/services/index.ts +2 -0
  10. package/core/services/sync-service.ts +1080 -0
  11. package/core/types/commands.ts +0 -12
  12. package/core/types/index.ts +0 -1
  13. package/dist/bin/prjct.mjs +1219 -310
  14. package/package.json +2 -8
  15. package/templates/_bases/tracker-base.md +309 -0
  16. package/templates/agentic/agent-routing.md +22 -88
  17. package/templates/agentic/agents/uxui.md +42 -197
  18. package/templates/agentic/context-filtering.md +14 -56
  19. package/templates/agentic/orchestrator.md +31 -365
  20. package/templates/agentic/skill-integration.md +37 -289
  21. package/templates/agentic/subagent-generation.md +31 -104
  22. package/templates/agentic/task-fragmentation.md +39 -273
  23. package/templates/agents/AGENTS.md +32 -188
  24. package/templates/commands/bug.md +22 -520
  25. package/templates/commands/dash.md +26 -161
  26. package/templates/commands/done.md +19 -250
  27. package/templates/commands/enrich.md +21 -732
  28. package/templates/commands/github.md +9 -0
  29. package/templates/commands/history.md +296 -83
  30. package/templates/commands/idea.md +18 -160
  31. package/templates/commands/init.md +20 -209
  32. package/templates/commands/jira.md +9 -0
  33. package/templates/commands/linear.md +9 -0
  34. package/templates/commands/merge.md +21 -185
  35. package/templates/commands/monday.md +9 -0
  36. package/templates/commands/next.md +21 -103
  37. package/templates/commands/p.md +198 -63
  38. package/templates/commands/pause.md +21 -272
  39. package/templates/commands/resume.md +19 -348
  40. package/templates/commands/setup.md +0 -1
  41. package/templates/commands/ship.md +30 -627
  42. package/templates/commands/sync.md +11 -1345
  43. package/templates/commands/task.md +17 -439
  44. package/templates/commands/test.md +30 -259
  45. package/CLAUDE.md +0 -211
  46. package/packages/shared/node_modules/@types/bun/LICENSE +0 -21
  47. package/packages/shared/node_modules/@types/bun/README.md +0 -20
  48. package/packages/shared/node_modules/@types/bun/index.d.ts +0 -1
  49. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/CLAUDE.md +0 -105
  50. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/README.md +0 -33
  51. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/bun.d.ts +0 -7032
  52. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/bun.ns.d.ts +0 -5
  53. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/bundle.d.ts +0 -74
  54. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/deprecated.d.ts +0 -184
  55. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/devserver.d.ts +0 -187
  56. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/README.md +0 -28
  57. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/bytecode.mdx +0 -465
  58. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/css.mdx +0 -1024
  59. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/esbuild.mdx +0 -298
  60. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/executables.mdx +0 -1277
  61. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/fullstack.mdx +0 -1086
  62. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/hot-reloading.mdx +0 -229
  63. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/html-static.mdx +0 -488
  64. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/index.mdx +0 -1604
  65. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/loaders.mdx +0 -451
  66. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/macros.mdx +0 -328
  67. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/minifier.mdx +0 -1286
  68. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/plugins.mdx +0 -425
  69. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/feedback.mdx +0 -75
  70. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-array.mdx +0 -29
  71. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-blob.mdx +0 -26
  72. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-buffer.mdx +0 -27
  73. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-string.mdx +0 -17
  74. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-typedarray.mdx +0 -41
  75. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-arraybuffer.mdx +0 -16
  76. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-dataview.mdx +0 -16
  77. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-stream.mdx +0 -16
  78. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-string.mdx +0 -17
  79. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-typedarray.mdx +0 -16
  80. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-arraybuffer.mdx +0 -16
  81. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-blob.mdx +0 -16
  82. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-readablestream.mdx +0 -43
  83. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-string.mdx +0 -27
  84. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-typedarray.mdx +0 -16
  85. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/dataview-to-string.mdx +0 -17
  86. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-arraybuffer.mdx +0 -27
  87. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-blob.mdx +0 -18
  88. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-buffer.mdx +0 -16
  89. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-dataview.mdx +0 -16
  90. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-readablestream.mdx +0 -43
  91. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-string.mdx +0 -18
  92. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/aws-lambda.mdx +0 -204
  93. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/digital-ocean.mdx +0 -161
  94. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/google-cloud-run.mdx +0 -194
  95. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/railway.mdx +0 -145
  96. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/render.mdx +0 -82
  97. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/vercel.mdx +0 -97
  98. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/astro.mdx +0 -82
  99. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/discordjs.mdx +0 -80
  100. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/docker.mdx +0 -151
  101. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/drizzle.mdx +0 -195
  102. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/elysia.mdx +0 -31
  103. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/express.mdx +0 -43
  104. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/gel.mdx +0 -261
  105. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/hono.mdx +0 -47
  106. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/mongoose.mdx +0 -92
  107. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/neon-drizzle.mdx +0 -234
  108. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/neon-serverless-postgres.mdx +0 -60
  109. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/nextjs.mdx +0 -103
  110. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/nuxt.mdx +0 -96
  111. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/pm2.mdx +0 -55
  112. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/prisma-postgres.mdx +0 -169
  113. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/prisma.mdx +0 -164
  114. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/qwik.mdx +0 -114
  115. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/react.mdx +0 -52
  116. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/remix.mdx +0 -97
  117. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/sentry.mdx +0 -54
  118. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/solidstart.mdx +0 -62
  119. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/ssr-react.mdx +0 -49
  120. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/stric.mdx +0 -54
  121. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/sveltekit.mdx +0 -138
  122. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/systemd.mdx +0 -114
  123. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/tanstack-start.mdx +0 -791
  124. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/upstash.mdx +0 -87
  125. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/vite.mdx +0 -77
  126. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/html-rewriter/extract-links.mdx +0 -71
  127. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/html-rewriter/extract-social-meta.mdx +0 -97
  128. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/cluster.mdx +0 -69
  129. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/fetch-unix.mdx +0 -35
  130. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/fetch.mdx +0 -26
  131. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/file-uploads.mdx +0 -97
  132. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/hot.mdx +0 -28
  133. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/proxy.mdx +0 -50
  134. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/server.mdx +0 -48
  135. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/simple.mdx +0 -20
  136. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/stream-file.mdx +0 -50
  137. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/stream-iterator.mdx +0 -49
  138. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/stream-node-streams-in-bun.mdx +0 -22
  139. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/tls.mdx +0 -32
  140. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/index.mdx +0 -10
  141. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-dev.mdx +0 -28
  142. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-git.mdx +0 -40
  143. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-optional.mdx +0 -27
  144. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-peer.mdx +0 -45
  145. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-tarball.mdx +0 -35
  146. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add.mdx +0 -44
  147. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/azure-artifacts.mdx +0 -76
  148. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/cicd.mdx +0 -43
  149. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/custom-registry.mdx +0 -32
  150. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/from-npm-install-to-bun-install.mdx +0 -230
  151. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/git-diff-bun-lockfile.mdx +0 -48
  152. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/jfrog-artifactory.mdx +0 -28
  153. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/npm-alias.mdx +0 -25
  154. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/registry-scope.mdx +0 -40
  155. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/trusted.mdx +0 -52
  156. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/workspaces.mdx +0 -70
  157. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/yarnlock.mdx +0 -51
  158. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/argv.mdx +0 -66
  159. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/ctrl-c.mdx +0 -18
  160. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/ipc.mdx +0 -69
  161. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/nanoseconds.mdx +0 -15
  162. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/os-signals.mdx +0 -31
  163. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/spawn-stderr.mdx +0 -34
  164. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/spawn-stdout.mdx +0 -28
  165. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/spawn.mdx +0 -43
  166. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/stdin.mdx +0 -62
  167. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/arraybuffer.mdx +0 -30
  168. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/buffer.mdx +0 -21
  169. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/exists.mdx +0 -18
  170. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/json.mdx +0 -19
  171. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/mime.mdx +0 -22
  172. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/stream.mdx +0 -28
  173. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/string.mdx +0 -24
  174. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/uint8array.mdx +0 -23
  175. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/watch.mdx +0 -66
  176. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/build-time-constants.mdx +0 -295
  177. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/cicd.mdx +0 -45
  178. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/codesign-macos-executable.mdx +0 -61
  179. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/define-constant.mdx +0 -149
  180. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/delete-directory.mdx +0 -39
  181. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/delete-file.mdx +0 -21
  182. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/heap-snapshot.mdx +0 -28
  183. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/import-html.mdx +0 -15
  184. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/import-json.mdx +0 -46
  185. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/import-toml.mdx +0 -32
  186. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/import-yaml.mdx +0 -104
  187. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/read-env.mdx +0 -37
  188. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/set-env.mdx +0 -51
  189. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/shell.mdx +0 -42
  190. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/timezone.mdx +0 -38
  191. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/tsconfig-paths.mdx +0 -31
  192. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/typescript.mdx +0 -51
  193. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/vscode-debugger.mdx +0 -47
  194. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/web-debugger.mdx +0 -103
  195. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-arraybuffer.mdx +0 -13
  196. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-blob.mdx +0 -13
  197. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-json.mdx +0 -14
  198. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-string.mdx +0 -14
  199. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-uint8array.mdx +0 -13
  200. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-array.mdx +0 -16
  201. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-arraybuffer.mdx +0 -16
  202. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-blob.mdx +0 -16
  203. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-buffer.mdx +0 -17
  204. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-json.mdx +0 -16
  205. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-string.mdx +0 -16
  206. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-typedarray.mdx +0 -24
  207. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/bail.mdx +0 -24
  208. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/concurrent-test-glob.mdx +0 -146
  209. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/coverage-threshold.mdx +0 -67
  210. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/coverage.mdx +0 -49
  211. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/happy-dom.mdx +0 -73
  212. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/migrate-from-jest.mdx +0 -125
  213. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/mock-clock.mdx +0 -50
  214. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/mock-functions.mdx +0 -70
  215. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/rerun-each.mdx +0 -16
  216. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/run-tests.mdx +0 -116
  217. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/skip-tests.mdx +0 -43
  218. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/snapshot.mdx +0 -102
  219. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/spy-on.mdx +0 -49
  220. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/svelte-test.mdx +0 -113
  221. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/testing-library.mdx +0 -93
  222. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/timeout.mdx +0 -17
  223. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/todo-tests.mdx +0 -74
  224. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/update-snapshots.mdx +0 -49
  225. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/watch-mode.mdx +0 -24
  226. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/base64.mdx +0 -17
  227. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/deep-equals.mdx +0 -41
  228. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/deflate.mdx +0 -20
  229. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/detect-bun.mdx +0 -28
  230. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/entrypoint.mdx +0 -19
  231. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/escape-html.mdx +0 -24
  232. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/file-url-to-path.mdx +0 -16
  233. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/gzip.mdx +0 -20
  234. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/hash-a-password.mdx +0 -56
  235. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/import-meta-dir.mdx +0 -15
  236. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/import-meta-file.mdx +0 -15
  237. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/import-meta-path.mdx +0 -15
  238. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/javascript-uuid.mdx +0 -25
  239. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/main.mdx +0 -43
  240. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/path-to-file-url.mdx +0 -16
  241. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/sleep.mdx +0 -24
  242. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/upgrade.mdx +0 -93
  243. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/version.mdx +0 -23
  244. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/which-path-to-executable-bin.mdx +0 -17
  245. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/websocket/compression.mdx +0 -33
  246. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/websocket/context.mdx +0 -79
  247. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/websocket/pubsub.mdx +0 -43
  248. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/websocket/simple.mdx +0 -38
  249. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/append.mdx +0 -54
  250. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/basic.mdx +0 -46
  251. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/blob.mdx +0 -30
  252. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/cat.mdx +0 -19
  253. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/file-cp.mdx +0 -18
  254. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/filesink.mdx +0 -54
  255. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/response.mdx +0 -19
  256. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/stdout.mdx +0 -23
  257. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/stream.mdx +0 -19
  258. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/unlink.mdx +0 -18
  259. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/index.mdx +0 -133
  260. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/installation.mdx +0 -365
  261. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/bunx.mdx +0 -91
  262. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/catalogs.mdx +0 -292
  263. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/add.mdx +0 -179
  264. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/audit.mdx +0 -60
  265. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/info.mdx +0 -70
  266. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/install.mdx +0 -606
  267. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/link.mdx +0 -61
  268. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/outdated.mdx +0 -197
  269. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/patch.mdx +0 -69
  270. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/pm.mdx +0 -323
  271. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/publish.mdx +0 -131
  272. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/remove.mdx +0 -16
  273. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/update.mdx +0 -140
  274. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/why.mdx +0 -84
  275. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/filter.mdx +0 -102
  276. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/global-cache.mdx +0 -72
  277. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/isolated-installs.mdx +0 -220
  278. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/lifecycle.mdx +0 -64
  279. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/lockfile.mdx +0 -64
  280. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/npmrc.mdx +0 -111
  281. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/overrides.mdx +0 -83
  282. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/scopes-registries.mdx +0 -35
  283. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/security-scanner-api.mdx +0 -95
  284. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/workspaces.mdx +0 -115
  285. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/benchmarking.mdx +0 -241
  286. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/bindgen.mdx +0 -223
  287. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/building-windows.mdx +0 -133
  288. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/contributing.mdx +0 -388
  289. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/feedback.mdx +0 -20
  290. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/license.mdx +0 -78
  291. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/roadmap.mdx +0 -8
  292. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/quickstart.mdx +0 -251
  293. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/auto-install.mdx +0 -97
  294. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/binary-data.mdx +0 -846
  295. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/bun-apis.mdx +0 -59
  296. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/bunfig.mdx +0 -723
  297. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/c-compiler.mdx +0 -204
  298. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/child-process.mdx +0 -659
  299. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/color.mdx +0 -267
  300. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/console.mdx +0 -67
  301. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/cookies.mdx +0 -454
  302. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/debugger.mdx +0 -335
  303. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/environment-variables.mdx +0 -231
  304. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/ffi.mdx +0 -565
  305. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/file-io.mdx +0 -306
  306. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/file-system-router.mdx +0 -118
  307. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/file-types.mdx +0 -435
  308. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/glob.mdx +0 -181
  309. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/globals.mdx +0 -72
  310. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/hashing.mdx +0 -315
  311. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/html-rewriter.mdx +0 -333
  312. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/cookies.mdx +0 -79
  313. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/error-handling.mdx +0 -40
  314. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/metrics.mdx +0 -36
  315. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/routing.mdx +0 -289
  316. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/server.mdx +0 -645
  317. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/tls.mdx +0 -101
  318. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/websockets.mdx +0 -414
  319. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/index.mdx +0 -223
  320. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/jsx.mdx +0 -115
  321. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/module-resolution.mdx +0 -374
  322. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/networking/dns.mdx +0 -111
  323. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/networking/fetch.mdx +0 -484
  324. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/networking/tcp.mdx +0 -239
  325. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/networking/udp.mdx +0 -129
  326. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/node-api.mdx +0 -19
  327. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/nodejs-compat.mdx +0 -468
  328. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/plugins.mdx +0 -419
  329. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/redis.mdx +0 -583
  330. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/s3.mdx +0 -863
  331. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/secrets.mdx +0 -340
  332. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/semver.mdx +0 -57
  333. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/shell.mdx +0 -637
  334. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/sql.mdx +0 -1404
  335. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/sqlite.mdx +0 -721
  336. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/streams.mdx +0 -232
  337. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/templating/create.mdx +0 -269
  338. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/templating/init.mdx +0 -58
  339. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/transpiler.mdx +0 -288
  340. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/typescript.mdx +0 -58
  341. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/utils.mdx +0 -922
  342. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/watch-mode.mdx +0 -161
  343. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/web-apis.mdx +0 -29
  344. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/workers.mdx +0 -314
  345. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/yaml.mdx +0 -469
  346. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/add.mdx +0 -166
  347. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/build.mdx +0 -196
  348. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/bunx.mdx +0 -49
  349. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/feedback.mdx +0 -17
  350. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/init.mdx +0 -84
  351. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/install.mdx +0 -173
  352. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/link.mdx +0 -163
  353. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/outdated.mdx +0 -140
  354. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/patch.mdx +0 -171
  355. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/publish.mdx +0 -198
  356. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/remove.mdx +0 -146
  357. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/run.mdx +0 -293
  358. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/test.mdx +0 -100
  359. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/update.mdx +0 -144
  360. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/code-coverage.mdx +0 -409
  361. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/configuration.mdx +0 -514
  362. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/dates-times.mdx +0 -129
  363. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/discovery.mdx +0 -90
  364. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/dom.mdx +0 -226
  365. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/index.mdx +0 -380
  366. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/lifecycle.mdx +0 -366
  367. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/mocks.mdx +0 -637
  368. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/reporters.mdx +0 -126
  369. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/runtime-behavior.mdx +0 -342
  370. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/snapshots.mdx +0 -434
  371. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/writing-tests.mdx +0 -672
  372. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/typescript.mdx +0 -54
  373. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/extensions.d.ts +0 -35
  374. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/fetch.d.ts +0 -79
  375. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/ffi.d.ts +0 -1154
  376. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/globals.d.ts +0 -2067
  377. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/html-rewriter.d.ts +0 -186
  378. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/index.d.ts +0 -32
  379. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/jsc.d.ts +0 -233
  380. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/overrides.d.ts +0 -376
  381. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/package.json +0 -37
  382. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/redis.d.ts +0 -3352
  383. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/s3.d.ts +0 -1299
  384. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/security.d.ts +0 -101
  385. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/serve.d.ts +0 -1296
  386. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/shell.d.ts +0 -380
  387. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/sql.d.ts +0 -887
  388. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/sqlite.d.ts +0 -1321
  389. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/test-globals.d.ts +0 -22
  390. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/test.d.ts +0 -2391
  391. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/branding.d.ts +0 -283
  392. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/index.d.ts +0 -1207
  393. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/messages.d.ts +0 -395
  394. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/overloads.d.ts +0 -669
  395. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/utils.d.ts +0 -431
  396. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/wasm.d.ts +0 -193
  397. package/packages/shared/node_modules/@types/bun/package.json +0 -53
  398. package/packages/shared/package.json +0 -29
  399. package/packages/shared/src/index.ts +0 -10
  400. package/packages/shared/src/schemas.ts +0 -124
  401. package/packages/shared/src/types.ts +0 -187
  402. package/packages/shared/src/unified.ts +0 -174
  403. package/packages/shared/src/utils.ts +0 -148
  404. package/packages/shared/tsconfig.json +0 -18
  405. package/templates/commands/redo.md +0 -144
  406. package/templates/commands/undo.md +0 -154
@@ -1,1286 +0,0 @@
1
- ---
2
- name: Minifier
3
- description: Reduce bundle sizes with Bun's JavaScript and TypeScript minifier
4
- ---
5
-
6
- Bun includes a fast JavaScript and TypeScript minifier that can reduce bundle sizes by 80% or more (depending on the codebase) and make output code run faster. The minifier performs dozens of optimizations including constant folding, dead code elimination, and syntax transformations. Unlike other minifiers, Bun's minifier makes `bun build` run faster since there's less code to print.
7
-
8
- ## CLI Usage
9
-
10
- ### Enable all minification
11
-
12
- Use the `--minify` flag to enable all minification modes:
13
-
14
- ```bash
15
- bun build ./index.ts --minify --outfile=out.js
16
- ```
17
-
18
- The `--minify` flag automatically enables:
19
-
20
- - Whitespace minification
21
- - Syntax minification
22
- - Identifier minification
23
-
24
- ### Production mode
25
-
26
- The `--production` flag automatically enables minification:
27
-
28
- ```bash
29
- bun build ./index.ts --production --outfile=out.js
30
- ```
31
-
32
- The `--production` flag also:
33
-
34
- - Sets `process.env.NODE_ENV` to `production`
35
- - Enables the production-mode JSX import & transform
36
-
37
- ### Granular control
38
-
39
- You can enable specific minification modes individually:
40
-
41
- ```bash
42
- # Only remove whitespace
43
- bun build ./index.ts --minify-whitespace --outfile=out.js
44
-
45
- # Only minify syntax
46
- bun build ./index.ts --minify-syntax --outfile=out.js
47
-
48
- # Only minify identifiers
49
- bun build ./index.ts --minify-identifiers --outfile=out.js
50
-
51
- # Combine specific modes
52
- bun build ./index.ts --minify-whitespace --minify-syntax --outfile=out.js
53
- ```
54
-
55
- ## JavaScript API
56
-
57
- When using Bun's bundler programmatically, configure minification through the `minify` option:
58
-
59
- ```ts
60
- await Bun.build({
61
- entrypoints: ["./index.ts"],
62
- outdir: "./out",
63
- minify: true, // Enable all minification modes
64
- });
65
- ```
66
-
67
- For granular control, pass an object:
68
-
69
- ```ts
70
- await Bun.build({
71
- entrypoints: ["./index.ts"],
72
- outdir: "./out",
73
- minify: {
74
- whitespace: true,
75
- syntax: true,
76
- identifiers: true,
77
- },
78
- });
79
- ```
80
-
81
- ## Minification Modes
82
-
83
- Bun's minifier has three independent modes that can be enabled separately or combined.
84
-
85
- ### Whitespace minification (`--minify-whitespace`)
86
-
87
- Removes all unnecessary whitespace, newlines, and formatting from the output.
88
-
89
- ### Syntax minification (`--minify-syntax`)
90
-
91
- Rewrites JavaScript syntax to shorter equivalent forms and performs constant folding, dead code elimination, and other optimizations.
92
-
93
- ### Identifier minification (`--minify-identifiers`)
94
-
95
- Renames local variables and function names to shorter identifiers using frequency-based optimization.
96
-
97
- ## All Transformations
98
-
99
- ### Boolean literal shortening
100
-
101
- **Mode:** `--minify-syntax`
102
-
103
- Converts boolean literals to shorter expressions.
104
-
105
- ```ts Input
106
- true
107
- false
108
- ```
109
-
110
- ```js Output
111
- !0
112
- !1
113
- ```
114
-
115
- ### Boolean algebra optimizations
116
-
117
- **Mode:** `--minify-syntax`
118
-
119
- Simplifies boolean expressions using logical rules.
120
-
121
- ```ts Input
122
- !!x
123
- x === true
124
- x && true
125
- x || false
126
- !true
127
- !false
128
- ```
129
-
130
- ```js Output
131
- x
132
- x
133
- x
134
- x
135
- !1
136
- !0
137
- ```
138
-
139
- ### Undefined shortening
140
-
141
- **Mode:** `--minify-syntax`
142
-
143
- Replaces `undefined` with shorter equivalent.
144
-
145
- ```ts Input
146
- undefined
147
- let x = undefined;
148
- ```
149
-
150
- ```js Output
151
- void 0
152
- let x=void 0;
153
- ```
154
-
155
- ### Undefined equality optimization
156
-
157
- **Mode:** `--minify-syntax`
158
-
159
- Optimizes loose equality checks with undefined.
160
-
161
- ```ts Input
162
- x == undefined
163
- x != undefined
164
- ```
165
-
166
- ```js Output
167
- x == null
168
- x != null
169
- ```
170
-
171
- ### Infinity shortening
172
-
173
- **Mode:** `--minify-syntax`
174
-
175
- Converts Infinity to mathematical expressions.
176
-
177
- ```ts Input
178
- Infinity
179
- -Infinity
180
- ```
181
-
182
- ```js Output
183
- 1/0
184
- -1/0
185
- ```
186
-
187
- ### Typeof optimizations
188
-
189
- **Mode:** `--minify-syntax`
190
-
191
- Optimizes typeof comparisons and evaluates constant typeof expressions.
192
-
193
- ```ts Input
194
- typeof x === 'undefined'
195
- typeof x !== 'undefined'
196
- typeof require
197
- typeof null
198
- typeof true
199
- typeof 123
200
- typeof "str"
201
- typeof 123n
202
- ```
203
-
204
- ```js Output
205
- typeof x>'u'
206
- typeof x<'u'
207
- "function"
208
- "object"
209
- "boolean"
210
- "number"
211
- "string"
212
- "bigint"
213
- ```
214
-
215
- ### Number formatting
216
-
217
- **Mode:** `--minify-syntax`
218
-
219
- Formats numbers in the most compact representation.
220
-
221
- ```ts Input
222
- 10000
223
- 100000
224
- 1000000
225
- 1.0
226
- -42.0
227
- ```
228
-
229
- ```js Output
230
- 1e4
231
- 1e5
232
- 1e6
233
- 1
234
- -42
235
- ```
236
-
237
- ### Arithmetic constant folding
238
-
239
- **Mode:** `--minify-syntax`
240
-
241
- Evaluates arithmetic operations at compile time.
242
-
243
- ```ts Input
244
- 1 + 2
245
- 10 - 5
246
- 3 * 4
247
- 10 / 2
248
- 10 % 3
249
- 2 ** 3
250
- ```
251
-
252
- ```js Output
253
- 3
254
- 5
255
- 12
256
- 5
257
- 1
258
- 8
259
- ```
260
-
261
- ### Bitwise constant folding
262
-
263
- **Mode:** `--minify-syntax`
264
-
265
- Evaluates bitwise operations at compile time.
266
-
267
- ```ts Input
268
- 5 & 3
269
- 5 | 3
270
- 5 ^ 3
271
- 8 << 2
272
- 32 >> 2
273
- ~5
274
- ```
275
-
276
- ```js Output
277
- 1
278
- 7
279
- 6
280
- 32
281
- 8
282
- -6
283
- ```
284
-
285
- ### String concatenation
286
-
287
- **Mode:** `--minify-syntax`
288
-
289
- Combines string literals at compile time.
290
-
291
- ```ts Input
292
- "a" + "b"
293
- "x" + 123
294
- "foo" + "bar" + "baz"
295
- ```
296
-
297
- ```js Output
298
- "ab"
299
- "x123"
300
- "foobarbaz"
301
- ```
302
-
303
- ### String indexing
304
-
305
- **Mode:** `--minify-syntax`
306
-
307
- Evaluates string character access at compile time.
308
-
309
- ```ts Input
310
- "foo"[2]
311
- "hello"[0]
312
- ```
313
-
314
- ```js Output
315
- "o"
316
- "h"
317
- ```
318
-
319
- ### Template literal folding
320
-
321
- **Mode:** `--minify-syntax`
322
-
323
- Evaluates template literals with constant expressions.
324
-
325
- ```ts Input
326
- `a${123}b`
327
- `result: ${5 + 10}`
328
- ```
329
-
330
- ```js Output
331
- "a123b"
332
- "result: 15"
333
- ```
334
-
335
- ### Template literal to string conversion
336
-
337
- **Mode:** `--minify-syntax`
338
-
339
- Converts simple template literals to regular strings.
340
-
341
- ```ts Input
342
- `Hello World`
343
- `Line 1
344
- Line 2`
345
- ```
346
-
347
- ```js Output
348
- "Hello World"
349
- "Line 1\nLine 2"
350
- ```
351
-
352
- ### String quote optimization
353
-
354
- **Mode:** `--minify-syntax`
355
-
356
- Chooses the optimal quote character to minimize escapes.
357
-
358
- ```ts Input
359
- "It's a string"
360
- 'He said "hello"'
361
- `Simple string`
362
- ```
363
-
364
- ```js Output
365
- "It's a string"
366
- 'He said "hello"'
367
- "Simple string"
368
- ```
369
-
370
- ### Array spread inlining
371
-
372
- **Mode:** `--minify-syntax`
373
-
374
- Inlines array spread operations with constant arrays.
375
-
376
- ```ts Input
377
- [1, ...[2, 3], 4]
378
- [...[a, b]]
379
- ```
380
-
381
- ```js Output
382
- [1,2,3,4]
383
- [a,b]
384
- ```
385
-
386
- ### Array indexing
387
-
388
- **Mode:** `--minify-syntax`
389
-
390
- Evaluates constant array access at compile time.
391
-
392
- ```ts Input
393
- [x][0]
394
- ['a', 'b', 'c'][1]
395
- ['a', , 'c'][1]
396
- ```
397
-
398
- ```js Output
399
- x
400
- 'b'
401
- void 0
402
- ```
403
-
404
- ### Property access optimization
405
-
406
- **Mode:** `--minify-syntax`
407
-
408
- Converts bracket notation to dot notation when possible.
409
-
410
- ```ts Input
411
- obj["property"]
412
- obj["validName"]
413
- obj["123"]
414
- obj["invalid-name"]
415
- ```
416
-
417
- ```js Output
418
- obj.property
419
- obj.validName
420
- obj["123"]
421
- obj["invalid-name"]
422
- ```
423
-
424
- ### Comparison folding
425
-
426
- **Mode:** `--minify-syntax`
427
-
428
- Evaluates constant comparisons at compile time.
429
-
430
- ```ts Input
431
- 3 < 5
432
- 5 > 3
433
- 3 <= 3
434
- 5 >= 6
435
- "a" < "b"
436
- ```
437
-
438
- ```js Output
439
- !0
440
- !0
441
- !0
442
- !1
443
- !0
444
- ```
445
-
446
- ### Logical operation folding
447
-
448
- **Mode:** `--minify-syntax`
449
-
450
- Simplifies logical operations with constant values.
451
-
452
- ```ts Input
453
- true && x
454
- false && x
455
- true || x
456
- false || x
457
- ```
458
-
459
- ```js Output
460
- x
461
- !1
462
- !0
463
- x
464
- ```
465
-
466
- ### Nullish coalescing folding
467
-
468
- **Mode:** `--minify-syntax`
469
-
470
- Evaluates nullish coalescing with known values.
471
-
472
- ```ts Input
473
- null ?? x
474
- undefined ?? x
475
- 42 ?? x
476
- ```
477
-
478
- ```js Output
479
- x
480
- x
481
- 42
482
- ```
483
-
484
- ### Comma expression simplification
485
-
486
- **Mode:** `--minify-syntax`
487
-
488
- Removes side-effect-free expressions from comma sequences.
489
-
490
- ```ts Input
491
- (0, x)
492
- (123, "str", x)
493
- ```
494
-
495
- ```js Output
496
- x
497
- x
498
- ```
499
-
500
- ### Ternary conditional folding
501
-
502
- **Mode:** `--minify-syntax`
503
-
504
- Evaluates conditional expressions with constant conditions.
505
-
506
- ```ts Input
507
- true ? a : b
508
- false ? a : b
509
- x ? true : false
510
- x ? false : true
511
- ```
512
-
513
- ```js Output
514
- a
515
- b
516
- x ? !0 : !1
517
- x ? !1 : !0
518
- ```
519
-
520
- ### Unary expression folding
521
-
522
- **Mode:** `--minify-syntax`
523
-
524
- Simplifies unary operations.
525
-
526
- ```ts Input
527
- +123
528
- +"123"
529
- -(-x)
530
- ~~x
531
- !!x
532
- ```
533
-
534
- ```js Output
535
- 123
536
- 123
537
- 123
538
- 123
539
- x
540
- ~~x
541
- !!x
542
- x
543
- ```
544
-
545
- ### Double negation removal
546
-
547
- **Mode:** `--minify-syntax`
548
-
549
- Removes unnecessary double negations.
550
-
551
- ```ts Input
552
- !!x
553
- !!!x
554
- ```
555
-
556
- ```js Output
557
- x
558
- !x
559
- ```
560
-
561
- ### If statement optimization
562
-
563
- **Mode:** `--minify-syntax`
564
-
565
- Optimizes if statements with constant conditions.
566
-
567
- ```ts Input
568
- if (true) x;
569
- if (false) x;
570
- if (x) { a; }
571
- if (x) {} else y;
572
- ```
573
-
574
- ```js Output
575
- x;
576
- // removed
577
- if(x)a;
578
- if(!x)y;
579
- ```
580
-
581
- ### Dead code elimination
582
-
583
- **Mode:** `--minify-syntax`
584
-
585
- Removes unreachable code and code without side effects.
586
-
587
- ```ts Input
588
- if (false) {
589
- unreachable();
590
- }
591
- function foo() {
592
- return x;
593
- deadCode();
594
- }
595
- ```
596
-
597
- ```js Output
598
- function foo(){return x}
599
- ```
600
-
601
- ### Unreachable branch removal
602
-
603
- **Mode:** `--minify-syntax`
604
-
605
- Removes branches that can never execute.
606
-
607
- ```ts Input
608
- while (false) {
609
- neverRuns();
610
- }
611
- ```
612
-
613
- ```js Output
614
- // removed entirely
615
- ```
616
-
617
- ### Empty block removal
618
-
619
- **Mode:** `--minify-syntax`
620
-
621
- Removes empty blocks and unnecessary braces.
622
-
623
- ```ts Input
624
- { }
625
- if (x) { }
626
- ```
627
-
628
- ```js Output
629
- ;
630
- // removed
631
- ```
632
-
633
- ### Single statement block unwrapping
634
-
635
- **Mode:** `--minify-syntax`
636
-
637
- Removes unnecessary braces around single statements.
638
-
639
- ```ts Input
640
- if (condition) {
641
- doSomething();
642
- }
643
- ```
644
-
645
- ```js Output
646
- if(condition)doSomething();
647
- ```
648
-
649
- ### TypeScript enum inlining
650
-
651
- **Mode:** `--minify-syntax`
652
-
653
- Inlines TypeScript enum values at compile time.
654
-
655
- ```ts Input
656
- enum Color { Red, Green, Blue }
657
- const x = Color.Red;
658
- ```
659
-
660
- ```js Output
661
- const x=0;
662
- ```
663
-
664
- ### Pure annotation support
665
-
666
- **Mode:** Always active
667
-
668
- Respects `/*@__PURE__*/` annotations for tree shaking.
669
-
670
- ```ts Input
671
- const x = /*@__PURE__*/ expensive();
672
- // If x is unused...
673
- ```
674
-
675
- ```js Output
676
- // removed entirely
677
- ```
678
-
679
- ### Identifier renaming
680
-
681
- **Mode:** `--minify-identifiers`
682
-
683
- Renames local variables to shorter names based on usage frequency.
684
-
685
- ```ts Input
686
- function calculateSum(firstNumber, secondNumber) {
687
- const result = firstNumber + secondNumber;
688
- return result;
689
- }
690
- ```
691
-
692
- ```js Output
693
- function a(b,c){const d=b+c;return d}
694
- ```
695
-
696
- **Naming strategy:**
697
-
698
- - Most frequently used identifiers get the shortest names (a, b, c...)
699
- - Single letters: a-z (26 names)
700
- - Double letters: aa-zz (676 names)
701
- - Triple letters and beyond as needed
702
-
703
- **Preserved identifiers:**
704
-
705
- - JavaScript keywords and reserved words
706
- - Global identifiers
707
- - Named exports (to maintain API)
708
- - CommonJS names: `exports`, `module`
709
-
710
- ### Whitespace removal
711
-
712
- **Mode:** `--minify-whitespace`
713
-
714
- Removes all unnecessary whitespace.
715
-
716
- ```ts Input
717
- function add(a, b) {
718
- return a + b;
719
- }
720
- let x = 10;
721
- ```
722
-
723
- ```js Output
724
- function add(a,b){return a+b;}let x=10;
725
- ```
726
-
727
- ### Semicolon optimization
728
-
729
- **Mode:** `--minify-whitespace`
730
-
731
- Inserts semicolons only when necessary.
732
-
733
- ```ts Input
734
- let a = 1;
735
- let b = 2;
736
- return a + b;
737
- ```
738
-
739
- ```js Output
740
- let a=1;let b=2;return a+b
741
- ```
742
-
743
- ### Operator spacing removal
744
-
745
- **Mode:** `--minify-whitespace`
746
-
747
- Removes spaces around operators.
748
-
749
- ```ts Input
750
- a + b
751
- x = y * z
752
- foo && bar || baz
753
- ```
754
-
755
- ```js Output
756
- a+b
757
- x=y*z
758
- foo&&bar||baz
759
- ```
760
-
761
- ### Comment removal
762
-
763
- **Mode:** `--minify-whitespace`
764
-
765
- Removes comments except important license comments.
766
-
767
- ```ts Input
768
- // This comment is removed
769
- /* So is this */
770
- /*! But this license comment is kept */
771
- function test() { /* inline comment */ }
772
- ```
773
-
774
- ```js Output
775
- /*! But this license comment is kept */
776
- function test(){}
777
- ```
778
-
779
- ### Object and array formatting
780
-
781
- **Mode:** `--minify-whitespace`
782
-
783
- Removes whitespace in object and array literals.
784
-
785
- ```ts Input
786
- const obj = {
787
- name: "John",
788
- age: 30
789
- };
790
- const arr = [1, 2, 3];
791
- ```
792
-
793
- ```js Output
794
- const obj={name:"John",age:30};const arr=[1,2,3];
795
- ```
796
-
797
- ### Control flow formatting
798
-
799
- **Mode:** `--minify-whitespace`
800
-
801
- Removes whitespace in control structures.
802
-
803
- ```ts Input
804
- if (condition) {
805
- doSomething();
806
- }
807
- for (let i = 0; i < 10; i++) {
808
- console.log(i);
809
- }
810
- ```
811
-
812
- ```js Output
813
- if(condition)doSomething();for(let i=0;i<10;i++)console.log(i);
814
- ```
815
-
816
- ### Function formatting
817
-
818
- **Mode:** `--minify-whitespace`
819
-
820
- Removes whitespace in function declarations.
821
-
822
- ```ts Input
823
- function myFunction(param1, param2) {
824
- return param1 + param2;
825
- }
826
- const arrow = (a, b) => a + b;
827
- ```
828
-
829
- ```js Output
830
- function myFunction(a,b){return a+b}const arrow=(a,b)=>a+b;
831
- ```
832
-
833
- ### Parentheses minimization
834
-
835
- **Mode:** Always active
836
-
837
- Only adds parentheses when necessary for operator precedence.
838
-
839
- ```ts Input
840
- (a + b) * c
841
- a + (b * c)
842
- ((x))
843
- ```
844
-
845
- ```js Output
846
- (a+b)*c
847
- a+b*c
848
- x
849
- ```
850
-
851
- ### Property mangling
852
-
853
- **Mode:** `--minify-identifiers` (with configuration)
854
-
855
- Renames object properties to shorter names when configured.
856
-
857
- ```ts Input
858
- obj.longPropertyName
859
- ```
860
-
861
- ```js Output (with property mangling enabled)
862
- obj.a
863
- ```
864
-
865
- ### Template literal value folding
866
-
867
- **Mode:** `--minify-syntax`
868
-
869
- Converts non-string interpolated values to strings and folds them into the template.
870
-
871
- ```ts Input
872
- `hello ${123}`
873
- `value: ${true}`
874
- `result: ${null}`
875
- `status: ${undefined}`
876
- `big: ${10n}`
877
- ```
878
-
879
- ```js Output
880
- "hello 123"
881
- "value: true"
882
- "result: null"
883
- "status: undefined"
884
- "big: 10"
885
- ```
886
-
887
- ### String length constant folding
888
-
889
- **Mode:** `--minify-syntax`
890
-
891
- Evaluates `.length` property on string literals at compile time.
892
-
893
- ```ts Input
894
- "hello world".length
895
- "test".length
896
- ```
897
-
898
- ```js Output
899
- 11
900
- 4
901
- ```
902
-
903
- ### Constructor call simplification
904
-
905
- **Mode:** `--minify-syntax`
906
-
907
- Simplifies constructor calls for built-in types.
908
-
909
- ```ts Input
910
- new Object()
911
- new Object(null)
912
- new Object({a: 1})
913
- new Array()
914
- new Array(x, y)
915
- ```
916
-
917
- ```js Output
918
- {}
919
- {}
920
- {a:1}
921
- []
922
- [x,y]
923
- ```
924
-
925
- ### Single property object inlining
926
-
927
- **Mode:** `--minify-syntax`
928
-
929
- Inlines property access for objects with a single property.
930
-
931
- ```ts Input
932
- ({fn: () => console.log('hi')}).fn()
933
- ```
934
-
935
- ```js Output
936
- (() => console.log('hi'))()
937
- ```
938
-
939
- ### String charCodeAt constant folding
940
-
941
- **Mode:** Always active
942
-
943
- Evaluates `charCodeAt()` on string literals for ASCII characters.
944
-
945
- ```ts Input
946
- "hello".charCodeAt(1)
947
- "A".charCodeAt(0)
948
- ```
949
-
950
- ```js Output
951
- 101
952
- 65
953
- ```
954
-
955
- ### Void 0 equality to null equality
956
-
957
- **Mode:** `--minify-syntax`
958
-
959
- Converts loose equality checks with `void 0` to `null` since they're equivalent.
960
-
961
- ```ts Input
962
- x == void 0
963
- x != void 0
964
- ```
965
-
966
- ```js Output
967
- x == null
968
- x != null
969
- ```
970
-
971
- ### Negation operator optimization
972
-
973
- **Mode:** `--minify-syntax`
974
-
975
- Moves negation operator through comma expressions.
976
-
977
- ```ts Input
978
- -(a, b)
979
- -(x, y, z)
980
- ```
981
-
982
- ```js Output
983
- a,-b
984
- x,y,-z
985
- ```
986
-
987
- ### Import.meta property inlining
988
-
989
- **Mode:** Bundle mode
990
-
991
- Inlines `import.meta` properties at build time when values are known.
992
-
993
- ```ts Input
994
- import.meta.dir
995
- import.meta.file
996
- import.meta.path
997
- import.meta.url
998
- ```
999
-
1000
- ```js Output
1001
- "/path/to/directory"
1002
- "filename.js"
1003
- "/full/path/to/file.js"
1004
- "file:///full/path/to/file.js"
1005
- ```
1006
-
1007
- ### Variable declaration merging
1008
-
1009
- **Mode:** `--minify-syntax`
1010
-
1011
- Merges adjacent variable declarations of the same type.
1012
-
1013
- ```ts Input
1014
- let a = 1;
1015
- let b = 2;
1016
- const c = 3;
1017
- const d = 4;
1018
- ```
1019
-
1020
- ```js Output
1021
- let a=1,b=2;
1022
- const c=3,d=4;
1023
- ```
1024
-
1025
- ### Expression statement merging
1026
-
1027
- **Mode:** `--minify-syntax`
1028
-
1029
- Merges adjacent expression statements using comma operator.
1030
-
1031
- ```ts Input
1032
- console.log(1);
1033
- console.log(2);
1034
- console.log(3);
1035
- ```
1036
-
1037
- ```js Output
1038
- console.log(1),console.log(2),console.log(3);
1039
- ```
1040
-
1041
- ### Return statement merging
1042
-
1043
- **Mode:** `--minify-syntax`
1044
-
1045
- Merges expressions before return with comma operator.
1046
-
1047
- ```ts Input
1048
- console.log(x);
1049
- return y;
1050
- ```
1051
-
1052
- ```js Output
1053
- return console.log(x),y;
1054
- ```
1055
-
1056
- ### Throw statement merging
1057
-
1058
- **Mode:** `--minify-syntax`
1059
-
1060
- Merges expressions before throw with comma operator.
1061
-
1062
- ```ts Input
1063
- console.log(x);
1064
- throw new Error();
1065
- ```
1066
-
1067
- ```js Output
1068
- throw(console.log(x),new Error());
1069
- ```
1070
-
1071
- ### TypeScript enum cross-module inlining
1072
-
1073
- **Mode:** `--minify-syntax` (bundle mode)
1074
-
1075
- Inlines enum values across module boundaries.
1076
-
1077
- ```ts Input
1078
- // lib.ts
1079
- export enum Color { Red, Green, Blue }
1080
-
1081
- // Input (main.ts)
1082
- import { Color } from './lib';
1083
- const x = Color.Red;
1084
- ```
1085
-
1086
- ```js Output
1087
- const x=0;
1088
- ```
1089
-
1090
- ### Computed property enum inlining
1091
-
1092
- **Mode:** `--minify-syntax`
1093
-
1094
- Inlines enum values used as computed object properties.
1095
-
1096
- ```ts Input
1097
- enum Keys { FOO = 'foo' }
1098
- const obj = { [Keys.FOO]: value }
1099
- ```
1100
-
1101
- ```js Output
1102
- const obj={foo:value}
1103
- ```
1104
-
1105
- ### String number to numeric index
1106
-
1107
- **Mode:** `--minify-syntax`
1108
-
1109
- Converts string numeric property access to numeric index.
1110
-
1111
- ```ts Input
1112
- obj["0"]
1113
- arr["5"]
1114
- ```
1115
-
1116
- ```js Output
1117
- obj[0]
1118
- arr[5]
1119
- ```
1120
-
1121
- ### Arrow function body shortening
1122
-
1123
- **Mode:** Always active
1124
-
1125
- Uses expression body syntax when an arrow function only returns a value.
1126
-
1127
- ```ts Input
1128
- () => { return x; }
1129
- (a) => { return a + 1; }
1130
- ```
1131
-
1132
- ```js Output
1133
- () => x
1134
- a => a + 1
1135
- ```
1136
-
1137
- ### Object property shorthand
1138
-
1139
- **Mode:** Always active
1140
-
1141
- Uses shorthand syntax when property name and value identifier match.
1142
-
1143
- ```ts Input
1144
- { x: x, y: y }
1145
- { name: name, age: age }
1146
- ```
1147
-
1148
- ```js Output
1149
- { x, y }
1150
- { name, age }
1151
- ```
1152
-
1153
- ### Method shorthand
1154
-
1155
- **Mode:** Always active
1156
-
1157
- Uses method shorthand syntax in object literals.
1158
-
1159
- ```ts Input
1160
- {
1161
- foo: function() {},
1162
- bar: async function() {}
1163
- }
1164
- ```
1165
-
1166
- ```js Output
1167
- {
1168
- foo() {},
1169
- async bar() {}
1170
- }
1171
- ```
1172
-
1173
- ### Drop debugger statements
1174
-
1175
- **Mode:** `--drop=debugger`
1176
-
1177
- Removes `debugger` statements from code.
1178
-
1179
- ```ts Input
1180
- function test() {
1181
- debugger;
1182
- return x;
1183
- }
1184
- ```
1185
-
1186
- ```js Output
1187
- function test(){return x}
1188
- ```
1189
-
1190
- ### Drop console calls
1191
-
1192
- **Mode:** `--drop=console`
1193
-
1194
- Removes all `console.*` method calls from code.
1195
-
1196
- ```ts Input
1197
- console.log("debug");
1198
- console.warn("warning");
1199
- x = console.error("error");
1200
- ```
1201
-
1202
- ```js Output
1203
- void 0;
1204
- void 0;
1205
- x=void 0;
1206
- ```
1207
-
1208
- ### Drop custom function calls
1209
-
1210
- **Mode:** `--drop=<name>`
1211
-
1212
- Removes calls to specified global functions or methods.
1213
-
1214
- ```ts Input
1215
- assert(condition);
1216
- obj.assert(test);
1217
- ```
1218
-
1219
- ```js Output with --drop=assert
1220
- void 0;
1221
- void 0;
1222
- ```
1223
-
1224
- ## Keep Names
1225
-
1226
- When minifying identifiers, you may want to preserve original function and class names for debugging purposes. Use the `--keep-names` flag:
1227
-
1228
- ```bash
1229
- bun build ./index.ts --minify --keep-names --outfile=out.js
1230
- ```
1231
-
1232
- Or in the JavaScript API:
1233
-
1234
- ```ts
1235
- await Bun.build({
1236
- entrypoints: ["./index.ts"],
1237
- outdir: "./out",
1238
- minify: {
1239
- identifiers: true,
1240
- keepNames: true,
1241
- },
1242
- });
1243
- ```
1244
-
1245
- This preserves the `.name` property on functions and classes while still minifying the actual identifier names in the code.
1246
-
1247
- ## Combined Example
1248
-
1249
- Using all three minification modes together:
1250
-
1251
- ```ts input.ts (158 bytes)
1252
- const myVariable = 42;
1253
-
1254
- const myFunction = () => {
1255
- const isValid = true;
1256
- const result = undefined;
1257
- return isValid ? myVariable : result;
1258
- };
1259
-
1260
- const output = myFunction();
1261
- ```
1262
-
1263
- ```js output.js
1264
- // Output with --minify (49 bytes, 69% reduction)
1265
- const a=42,b=()=>{const c=!0,d=void 0;return c?a:d},e=b();
1266
- ```
1267
-
1268
- ## When to Use Minification
1269
-
1270
- **Use `--minify` for:**
1271
-
1272
- - Production bundles
1273
- - Reducing CDN bandwidth costs
1274
- - Improving page load times
1275
-
1276
- **Use individual modes for:**
1277
-
1278
- - **`--minify-whitespace`:** Quick size reduction without semantic changes
1279
- - **`--minify-syntax`:** Smaller output while keeping readable identifiers for debugging
1280
- - **`--minify-identifiers`:** Maximum size reduction (combine with `--keep-names` for better stack traces)
1281
-
1282
- **Avoid minification for:**
1283
-
1284
- - Development builds (harder to debug)
1285
- - When you need readable error messages
1286
- - Libraries where consumers may read the source