Fork me on GitHub

@slack1338 no, that is only setup to require exports

Joshua Smock11:11:05

To give a little bit of context, I’m looking into other ways to combine CLJS and Jest. Jest supports ESM and has some nice advantages to using those files. As an alternative, would it be possible to configure the :js-options :js-provider for the :npm-module target? I tried to but it didn’t seem to work and I’d like to be able to set it to :import so that it uses import("./some-file") rather than require(…)


:npm-module only outputs commonjs so it cannot use import


Hi, I have a vanilla browser-test setup working and I visit the browser-test page on localhost. When I remove the config from shadow-cljs.edn and invoke the api like this:

    {:build-id :test
     :target    :browser-test
     :test-dir  "target/public/js/test"
     :devtools  {:http-port          8021
                 :http-root          "target/public/js/test"}} 
    {:verbose false})
the watch appears to start normally, but there is no browser-test server started. is there something else I need to do when using the api to make this work?


I see it's getting the config from file, rather than using what was passed in to start shadow server


ended up alter-var-rooting the get-server-configs var in that ns. I think I can get by with just dev servers passed at top level, so if it used the server config passed in to start the shadow server, rather than reading from the file, that would work in that case at least


can you explain a little bit what you are doing? http servers are not coupled to builds and all http related :devtools config is deprecated. I just still allow it to not break old templates and such


sure. briefly, I am using shadow via api functions. my shadow-cljs.edn file is currently empty. I call the function to start the main server, then call things like watch that I posted an example of. this is because we have many builds across many projects and so benefit from sharing boilerplate via code. we could write out shadow-cljs.edn files and then invoke api calls with build ids and so on but since I can pass in config directly to the functions that seems preferable. the pr still means changes from shadow-cljs.edn are picked up as it is changed - everything still works. it just also means the config from the initial call to start the main server (whether passed as arg or got from shadow file) is used to start dev servers


:dev-http is nothing but a simple static webserver. when you start your "main server" I assume that already has a webserver? why not use that?


by main server , I mean the shadow one, which has the dashboard ui. yes if I could get that to serve some resources of my choosing, that would work


... while keeping the shadow dashboard working under / ofc


no I meant something like jetty or whatever webserver you are using?


most people that go with this type of total custom setup (ie. no shadow-cljs.edn) tend to use their own servers?


oh I see. yeah that's a possibility. I'd rather configure it as per the shadow guide though. It makes it easier for others to follow


to be clearer about what I mean about getting shadow to use the config passed in to the main server, I mean I want the args I pass to shadow.cljs.devtools.server/start! to make it through to the dev-http stuff. that's what the pr achieves, while keeping the watch on shadow-cljs.edn working


decided to clean it up a little more than your pr did


awesome :thumbsup: . thanks


released in 2.16.5


also updated to make it not use http-root given its deprecated status