Fork me on GitHub
#shadow-cljs
<
2019-11-27
>
tianshu03:11:01

can I use some css file installed by npm install without copy them into resources/public? should I use webpack? or there is a some simpler way?

grav08:11:03

A symlink might be a better way - I've used those with Git without problems.

grav08:11:58

Eg ln -s resources/public/styles.css node_modules/foobar/styles.css

tianshu17:11:24

but, will symlink work on windows?

grav08:11:05

Using shadow-cljs and deps.edn together - what is the minimal amount of configuration necessary? Reading https://shadow-cljs.github.io/docs/UsersGuide.html#deps-edn, it's suggested to use :deps true in the shadow-cljs.edn config file, but below that, it's stated that one must add thheller/shadow-cljs to deps.edn, and the example states to add it in :extra-deps, which in turn seems to require an alias, according to both the example and the deps ref: https://clojure.org/guides/deps_and_cli#extra_deps. Using an alias in turn means that :deps true is not enough, since one need to specify the alias, eg :deps {:aliases [:cljs]} . If this is correctly interpreted, I'd suggest removing the :deps true example for the next newcomer 🙂

p-himik09:11:29

But the documentation isn't for newcomers, it's for everybody.

grav11:11:51

Sure, but if it's not possible at all to use :deps true, it might be a blocker, especially for newcomers.

p-himik13:11:33

It is possible!

p-himik13:11:09

Moving some dependencies under aliases just makes sure that you don't bring unneeded stuff along. Well, most of the time. Since you don't need shadow-cljs to actually run release versions of applications, it makes sense to move it under an alias that's only used during the development and UI release.

enocom22:11:54

I’m running tests for my browser application using the node-target, but now I have some code that uses js/window and am trying to use jsdom in a sensible way. The best I’ve come up with so far is conditional initialization in src files, i.e., if there is no window present, make a fake one with jsdom . I’m curious if there’s a better way, though. Would build hooks be a possible alternative? Does anyone have any experience with this problem?

Filipe Silva01:11:44

In create-cljs-app I just made a node only entry point that adds jsdom

enocom02:11:40

Thanks! I’ll take a look!

lilactown23:11:30

I prefer to use karma or some other headless browser to run my tests, rather than running tests in Node.js