Open derekchiang opened 6 years ago
Should work the same as server-side if you include them under :npm {:dependencies [...]}
. There isn't an example available, but you can make a new project with the client-side support by adding the +browser
flag thanks to this pr by @nenadalm.
@derekchiang I was playing with it yesterday and sometimes you need to create single file first: http://blob.tomerweller.com/reagent-import-react-components-from-npm.
There should be support for it in clojurescript: https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules but it's not finished yet (I was trying it with newest beta of http://www.material-ui.com/#/ and I wasn't able to configure it so that it would work. It was working only by using webpack as described in the first link).
@derekchiang also I don't know if you're aware of https://cljsjs.github.io/ - it contains some js libraries packaged and ready for clojurescript.
shadow-cljs is also worth looking at for this
Yeah, my team has migrated to using shadow-cljs specifically because of it's much better consumption of NPM modules.
Is it possible to use NPM modules on the client side? If so, is there an example for it?