Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2048,21 +2048,24 @@ another URL, such as a CDN. By default hyper serves it at
### Tree shaking

Pass `:tree-shake? true` to `create-handler` to serve only the Squint core
functions that your `h/expr` expressions and `defc` components use, instead of all of
`/hyper/squint-core.js` (28 KB brotli-compressed):
functions that your `h/expr` expressions and `defc` components use, plus the
functions those depend on, minified. Without it, hyper serves all of
`/hyper/squint-core.js` (28 KB brotli-compressed).

```clojure
(h/create-handler #'routes :tree-shake? true)
```

Add esbuild to `deps.edn`:
Add the optional esbuild dependency to `deps.edn`:

```clojure
org.babashka/esbuild {:mvn/version "0.1.1"}
```

Add `--enable-native-access=ALL-UNNAMED` to your JVM options for esbuild.
Without esbuild on the classpath, `create-handler` throws.
The `org.babashka/esbuild` library calls esbuild through the JVM's foreign
function API. Add `--enable-native-access=ALL-UNNAMED` to your JVM options to
avoid the JVM's native access warning. Without esbuild on the classpath,
`create-handler` throws.

### Editor indentation

Expand Down
Loading