@hono/cli 0.1.5 → 0.1.7
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.
- package/README.md +14 -0
- package/dist/cli.js +16003 -38
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -244,6 +244,12 @@ hono serve \
|
|
|
244
244
|
|
|
245
245
|
Generate an optimized Hono class and export bundled file.
|
|
246
246
|
|
|
247
|
+
This command automatically applies the following optimizations to reduce bundle size:
|
|
248
|
+
|
|
249
|
+
- **Request body API removal**: Removes request body APIs (`c.req.json()`, `c.req.formData()`, etc.) when your application only uses GET, HEAD, or OPTIONS methods
|
|
250
|
+
- **Context response API removal**: Removes unused response utility APIs (`c.body()`, `c.json()`, `c.text()`, `c.html()`, `c.redirect()`) from Context object
|
|
251
|
+
- **Hono API removal**: Removes unused Hono methods (`route`, `mount`, `fire`) that are only used during application initialization
|
|
252
|
+
|
|
247
253
|
```bash
|
|
248
254
|
hono optimize [entry] [options]
|
|
249
255
|
```
|
|
@@ -257,6 +263,9 @@ hono optimize [entry] [options]
|
|
|
257
263
|
- `-o, --outfile <outfile>` - Output file
|
|
258
264
|
- `-m, --minify` - minify output file
|
|
259
265
|
- `-t, --target [target]` - environment target
|
|
266
|
+
- `--no-request-body-api-removal` - Disable request body API removal optimization
|
|
267
|
+
- `--no-context-response-api-removal` - Disable response utility API removal from Context object
|
|
268
|
+
- `--no-hono-api-removal` - Disable Hono API removal optimization
|
|
260
269
|
|
|
261
270
|
**Examples:**
|
|
262
271
|
|
|
@@ -272,6 +281,11 @@ hono optimize -m
|
|
|
272
281
|
|
|
273
282
|
# Specify environment target
|
|
274
283
|
hono optimize -t es2024
|
|
284
|
+
|
|
285
|
+
# Disable specific optimizations
|
|
286
|
+
hono optimize -m --no-request-body-api-removal
|
|
287
|
+
hono optimize -m --no-context-response-api-removal
|
|
288
|
+
hono optimize -m --no-hono-api-removal
|
|
275
289
|
```
|
|
276
290
|
|
|
277
291
|
## Tips
|