helix

https://github.com/Lokeh/helix
adkelley 2020-11-30T15:24:37.209700Z

I’m testing out ClojureScript with Webpack. Does anyone have an example of build.edn and deps.edn files for helix? Thanks.

2020-11-30T20:43:18.212200Z

@alex.kelley Do you use shadow-cljs for compilation ?

adkelley 2020-11-30T20:48:23.215Z

@geraldodev Yes, I have in the past, and it works fine. Given that ClojureScript >1.10.741 is https://clojurescript.org/news/2020-04-24-bundle-target ClojureScript with Javascript Bundlers, such as Webpack, I thought I’d give it a try with Helix.

2020-11-30T21:16:08.217100Z

I'm glad that shadow-cljs postponned the necessity of using webpack until I needed to run a css loader. I discovered shadow-cljs with fulcro-template . I still use fulcro template as a base (remove fulcro and pathom) and use the rest.

2020-11-30T21:17:54.218300Z

with shadow-cljs.edn I have :js-options {:js-provider :external :external-index "target/js_libs_for_webpack.js"} and I process that with a simple enough (i hate webpack config) file.

lilactown 2020-11-30T21:20:57.220600Z

@alex.kelley I haven't tried the :bundle target with webpack yet. Is there something specific that you're getting stuck on?

2020-11-30T21:21:03.220700Z

I'm glad that cljs has the ability of consuming npm libraries, but shadow-cljs was ahead on that (experimenting, leading the way) It looks like.

adkelley 2020-11-30T21:40:31.222600Z

@lilactown I just got it working using your example in the README! Here’s the build.edn file:

{:main hello-bundler.core
 :output-to "out/index.js"
 :output-dir "out"
 :target :bundle
 :bundle-cmd {:none ["npx" "webpack" "./out/index.js" "-o" "./out" "--mode=development"]
              :default ["npx" "webpack" "./out/index.js" "-o" "./out"]}
 :closure-defines {cljs.core/*global* "window"}} ;; needed for advance
Here’s the deps.edn file:
{:deps {org.clojure/clojurescript {:mvn/version "1.10.773"}
        lilactown/helix {:mvn/version "0.0.13"}}}
Both clj -M -m cljs.main -co build.edn -v -c -r and clj -M -m cljs.main -co build.edn -O advanced -v -c -s work correctly.

1
❤️ 1