This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-30
Channels
- # adventofcode (4)
- # aleph (1)
- # announcements (7)
- # aws (10)
- # babashka (23)
- # beginners (23)
- # calva (20)
- # chlorine-clover (13)
- # cider (17)
- # clj-kondo (13)
- # cljfx (9)
- # cljsrn (9)
- # clojure (98)
- # clojure-australia (1)
- # clojure-dev (15)
- # clojure-europe (127)
- # clojure-nl (4)
- # clojure-sanfrancisco (3)
- # clojure-uk (98)
- # clojurescript (25)
- # community-development (8)
- # core-async (15)
- # cryogen (9)
- # cursive (7)
- # data-science (1)
- # datascript (5)
- # datomic (3)
- # devcards (2)
- # fulcro (5)
- # graalvm (1)
- # helix (8)
- # jackdaw (1)
- # jobs (5)
- # kaocha (17)
- # malli (5)
- # meander (5)
- # off-topic (37)
- # pathom (33)
- # pedestal (3)
- # re-frame (12)
- # reitit (1)
- # remote-jobs (3)
- # sci (1)
- # shadow-cljs (6)
- # testing (1)
- # vim (6)
- # vrac (5)
I’m testing out ClojureScript with Webpack. Does anyone have an example of build.edn
and deps.edn
files for helix? Thanks.
@alex.kelley Do you use shadow-cljs for compilation ?
@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.
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.
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.
@alex.kelley I haven't tried the :bundle
target with webpack yet. Is there something specific that you're getting stuck on?
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.
@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.