https://github.com/borkdude/bun-squint-loader
https://github.com/borkdude/bun-squint-loader
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/borkdude/bun-squint-loader
- Owner: borkdude
- Created: 2023-09-13T12:15:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-13T13:44:58.000Z (over 2 years ago)
- Last Synced: 2025-03-31T01:51:16.721Z (10 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 18
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bun-squint-loader
This is a demo of a loader for [bun](https://bun.sh/) which invokes the [squint-cljs](https://github.com/squint-cljs/squint) compiler.
Run `bun index.js`:
``` javascript
import { the_number } from "./calc.cljs";
console.log('hello, (+ 1 2 3) => ', the_number );
```
``` shell
$ bun index.js
```
The output will be:
```
hello, (+ 1 2 3) => 6
```
The number `6` is calculated from a `.cljs` file:
```
$ cat calc.cljs
(def the-number (+ 1 2 3))
```
To build/bundle/minify, run `bun build.js`.
This will yield an `index.js` file in `dist` which is smaller than 100 bytes!