This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-12
Channels
- # announcements (7)
- # babashka (13)
- # beginners (14)
- # business (7)
- # clerk (4)
- # clj-kondo (21)
- # clojure (42)
- # clojure-denmark (5)
- # clojure-dev (16)
- # clojure-europe (27)
- # clojure-finland (1)
- # clojure-nl (1)
- # clojure-norway (36)
- # clojure-sweden (2)
- # clojure-uk (34)
- # clojurescript (29)
- # datomic (15)
- # emacs (1)
- # hyperfiddle (13)
- # jobs (11)
- # joyride (8)
- # malli (15)
- # missionary (10)
- # off-topic (5)
- # portal (6)
- # releases (3)
- # shadow-cljs (9)
- # spacemacs (28)
- # specter (2)
- # squint (12)
Did anyone make a webpack loader for squint? 🙂 Based on this it looks like it might not be too hard? https://github.com/webpack-contrib/coffee-loader/
I did make a loader for bun once: https://github.com/borkdude/bun-squint-loader
not sure if that's the way to go though, just running the squint compiller and using vite on top of that is my favorite workflow right now
whats the best example of that I could look at? Maybe it also works for my use case too
here is an example project: https://github.com/squint-cljs/squint/tree/main/examples/vite-react
Cool! FYI, it's super trivial to just let vite to the compiling:
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import { compileString } from "squint-cljs";
//
export default defineConfig({
plugins: [
preact(),
{
name: "squint_compile",
transform: function (src, id) {
// compile cljs files to js
if (/\.cljs$/.test(id)) {
var js = compileString(src);
return { code: js, map: null };
}
},
},
],
});
I feel like this is slightly more elegant than running the squint compiler in a separate process?
yeah, i wonder how it works with transitive stuff
the squint CLI doesn't care about transitive stuff at the moment, it just compiles the file that changed, that's it
I might look into this a bit more, I think a first class integration with something like Vite would be cool!