Gold Ayan's Tinker Garage

Ensure you have bun installed in your system

Tip:

Very simple Squint project

  • Create a temp directory and change into it
mkdir squint-demo
cd squint-demo
  • Once you are inside
bun add squint-cljs
  • If you are using node and bun parallel, then in windows i faced the issue while running bun squint --help.

    bun .\node_modules\squint-cljs\node_cli.js --help
    
  • create a sample.cljs file
  (ns main)

(defn greet [name]
  (str "Hello, " name " from Squint!"))

;; Simple DOM manipulation
(let [app (.getElementById js/document "app")]
  (set! (.-innerText app) (greet "User")))

(js/console.log "Squint is running!")
  • Compile the above script to js or mjs
bun .\node_modules\squint-cljs\node_cli.js compile .\sample.cljs
  • Build for browser using
bun build .\sample.mjs --outfile .\sample.js
bun build .\sample.mjs --outfile .\sample.js --minify // for minification
  • If you have more than one js file in a folder
bun .\node_modules\squint-cljs\node_cli.js compile src --out-dir out
bun build ./out/main.js --outdir ./dist --minify --target browser